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

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

?? analyse.c

?? 圖象壓縮程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************************** * analyse.c: h264 encoder library ***************************************************************************** * Copyright (C) 2003 Laurent Aimar * $Id: analyse.c,v 1.6 2004/03/28 12:37:11 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 <stdlib.h>#include <stdio.h>#include <string.h>#include <stdint.h>#include <math.h>#include "../core/common.h"#include "me.h"static const uint8_t block_idx_x[16] = { 0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 0, 1, 2, 3, 2, 3 };static const uint8_t block_idx_y[16] = { 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3 };/* * Handle intra mb *//* Max = 4 */static void predict_16x16_mode_available( x264_macroblock_t *mb, int *mode, int *pi_count ){    if( ( mb->i_neighbour & (MB_LEFT|MB_TOP) ) == (MB_LEFT|MB_TOP) )    {        /* top and left avaible */        *mode++ = I_PRED_16x16_V;        *mode++ = I_PRED_16x16_H;        *mode++ = I_PRED_16x16_DC;        *mode++ = I_PRED_16x16_P;        *pi_count = 4;    }    else if( ( mb->i_neighbour & MB_LEFT ) )    {        /* left available*/        *mode++ = I_PRED_16x16_DC_LEFT;        *mode++ = I_PRED_16x16_H;        *pi_count = 2;    }    else if( ( mb->i_neighbour & MB_TOP ) )    {        /* top available*/        *mode++ = I_PRED_16x16_DC_TOP;        *mode++ = I_PRED_16x16_V;        *pi_count = 2;    }    else    {        /* none avaible */        *mode = I_PRED_16x16_DC_128;        *pi_count = 1;    }}/* Max = 4 */static void predict_8x8_mode_available( x264_macroblock_t *mb, int *mode, int *pi_count ){    if( ( mb->i_neighbour & (MB_LEFT|MB_TOP) ) == (MB_LEFT|MB_TOP) )    {        /* top and left avaible */        *mode++ = I_PRED_CHROMA_V;        *mode++ = I_PRED_CHROMA_H;        *mode++ = I_PRED_CHROMA_DC;        *mode++ = I_PRED_CHROMA_P;        *pi_count = 4;    }    else if( ( mb->i_neighbour & MB_LEFT ) )    {        /* left available*/        *mode++ = I_PRED_CHROMA_DC_LEFT;        *mode++ = I_PRED_CHROMA_H;        *pi_count = 2;    }    else if( ( mb->i_neighbour & MB_TOP ) )    {        /* top available*/        *mode++ = I_PRED_CHROMA_DC_TOP;        *mode++ = I_PRED_CHROMA_V;        *pi_count = 2;    }    else    {        /* none avaible */        *mode = I_PRED_CHROMA_DC_128;        *pi_count = 1;    }}/* MAX = 8 */static void predict_4x4_mode_available( x264_macroblock_t *mb, int idx, int *mode, int *pi_count ){    int b_a, b_b, b_c;    static const int needmb[16] =    {        MB_LEFT|MB_TOP, MB_TOP,        MB_LEFT,        MB_PRIVATE,        MB_TOP,         MB_TOP|MB_TOPRIGHT,        0,              MB_PRIVATE,        MB_LEFT,        0,        MB_LEFT,        MB_PRIVATE,        0,              MB_PRIVATE,        0,              MB_PRIVATE    };    /* FIXME even when b_c == 0 there is some case where missing pixels     * are emulated and thus more mode are available TODO     * analysis and encode should be fixed too */    b_a = (needmb[idx]&mb->i_neighbour&MB_LEFT) == (needmb[idx]&MB_LEFT);    b_b = (needmb[idx]&mb->i_neighbour&MB_TOP) == (needmb[idx]&MB_TOP);    b_c = (needmb[idx]&mb->i_neighbour&(MB_TOPRIGHT|MB_PRIVATE)) == (needmb[idx]&(MB_TOPRIGHT|MB_PRIVATE));    if( b_a && b_b )    {        *mode++ = I_PRED_4x4_DC;        *mode++ = I_PRED_4x4_H;        *mode++ = I_PRED_4x4_V;        *mode++ = I_PRED_4x4_DDR;        *mode++ = I_PRED_4x4_VR;        *mode++ = I_PRED_4x4_HD;        *mode++ = I_PRED_4x4_HU;        *pi_count = 7;        if( b_c )        {            *mode++ = I_PRED_4x4_DDL;            *mode++ = I_PRED_4x4_VL;            (*pi_count) += 2;        }    }    else if( b_a && !b_b )    {        *mode++ = I_PRED_4x4_DC_LEFT;        *mode++ = I_PRED_4x4_H;        *pi_count = 2;    }    else if( !b_a && b_b )    {        *mode++ = I_PRED_4x4_DC_TOP;        *mode++ = I_PRED_4x4_V;        *pi_count = 2;    }    else    {        *mode++ = I_PRED_4x4_DC_128;        *pi_count = 1;    }}typedef struct{    /* conduct the analysis using this lamda and QP */    int i_lambda;    int i_qp;    /* I: Intra part */    /* Luma part 16x16 and 4x4 modes stats */    int i_sad_i16x16;    int i_predict16x16;    int i_sad_i4x4;    int i_predict4x4[4][4];    /* Chroma part */    int i_sad_i8x8;    int i_predict8x8;    /* II: Inter part P frame */    int i_sad_p16x16;    int i_ref_p16x16;    int i_mv_p16x16[2];    int i_sad_p16x8;    int i_ref_p16x8;    int i_mv_p16x8[2][2];    int i_sad_p8x16;    int i_ref_p8x16;    int i_mv_p8x16[2][2];    int i_sad_p8x8;    int i_ref_p8x8;    int i_sub_partition_p8x8[4];    int i_mv_p8x8[4][4][2];    /* II: Inter part B frame */    int i_sad_b16x16_l0;    int i_ref_b16x16_l0;    int i_mv_b16x16_l0[2];    int i_sad_b16x16_l1;    int i_ref_b16x16_l1;    int i_mv_b16x16_l1[2];    int i_sad_b16x16_bi;    /* used the same ref and mv as l0 and l1 (at least for now) */    int i_sad_b16x8_l0;    int i_ref_b16x8_l0;    int i_mv_b16x8_l0[2];    int i_sad_b8x16_l0;    int i_ref_b8x16_l0;    int i_mv_b8x16_l0[2];} x264_mb_analysis_t;static const int i_qp0_cost_table[52] ={   1, 1, 1, 1, 1, 1, 1, 1,   1, 1, 1, 1,   1, 1, 1, 1, 2, 2, 2, 2,   3, 3, 3, 4, 4, 4, 5, 6,   6, 7, 8, 9,10,11,13,14,  16,18,20,23,25,29,32,36,  40,45,51,57,64,72,81,91};static void x264_mb_analyse_intra_chroma( x264_t *h, x264_macroblock_t *mb, x264_mb_analysis_t *res ){    x264_mb_context_t *ctx = mb->context;    int i;    int i_max;    int predict_mode[9];    uint8_t *p_dstc[2], *p_srcc[2];    int      i_dstc[2], i_srcc[2];    /* 8x8 prediction selection for chroma */    p_dstc[0] = ctx->p_fdec[1]; i_dstc[0] = ctx->i_fdec[1];    p_dstc[1] = ctx->p_fdec[2]; i_dstc[1] = ctx->i_fdec[2];    p_srcc[0] = ctx->p_img[1];  i_srcc[0] = ctx->i_img[1];    p_srcc[1] = ctx->p_img[2];  i_srcc[1] = ctx->i_img[2];    predict_8x8_mode_available( mb, predict_mode, &i_max );    res->i_sad_i8x8 = -1;    for( i = 0; i < i_max; i++ )    {        int i_sad;        int i_mode;        i_mode = predict_mode[i];        /* we do the prediction */        h->predict_8x8[i_mode]( p_dstc[0], i_dstc[0] );        h->predict_8x8[i_mode]( p_dstc[1], i_dstc[1] );        /* we calculate the cost */        i_sad = h->pixf.satd[PIXEL_8x8]( p_dstc[0], i_dstc[0], p_srcc[0], i_srcc[0] ) +                h->pixf.satd[PIXEL_8x8]( p_dstc[1], i_dstc[1], p_srcc[1], i_srcc[1] ) +                res->i_lambda * bs_size_ue( x264_mb_pred_mode8x8_fix[i_mode] );        /* if i_score is lower it is better */        if( res->i_sad_i8x8 == -1 || res->i_sad_i8x8 > i_sad )        {            res->i_predict8x8 = i_mode;            res->i_sad_i8x8     = i_sad;        }    }}static void x264_mb_analyse_intra( x264_t *h, x264_macroblock_t *mb, x264_mb_analysis_t *res ){    int i, idx;    int i_max;    int predict_mode[9];    uint8_t *p_dst, *p_src;    int      i_dst, i_src;    p_dst = mb->context->p_fdec[0]; i_dst = mb->context->i_fdec[0];    p_src = mb->context->p_img[0];  i_src = mb->context->i_img[0];    /*---------------- Try all mode and calculate their score ---------------*/    /* 16x16 prediction selection */    mb->i_type = I_16x16;    res->i_sad_i16x16 = -1;    predict_16x16_mode_available( mb, predict_mode, &i_max );    for( i = 0; i < i_max; i++ )    {        int i_sad;        int i_mode;        i_mode = predict_mode[i];        /* we do the prediction */        h->predict_16x16[i_mode]( p_dst, i_dst );        /* we calculate the diff and get the square sum of the diff */        i_sad = h->pixf.satd[PIXEL_16x16]( p_dst, i_dst, p_src, i_src ) +                res->i_lambda * bs_size_ue( x264_mb_pred_mode16x16_fix[i_mode] );        /* if i_score is lower it is better */        if( res->i_sad_i16x16 == -1 || res->i_sad_i16x16 > i_sad )        {            res->i_predict16x16 = i_mode;            res->i_sad_i16x16     = i_sad;        }    }    /* 4x4 prediction selection */    mb->i_type = I_4x4;    res->i_sad_i4x4 = 0;    for( idx = 0; idx < 16; idx++ )    {        uint8_t *p_src_by;        uint8_t *p_dst_by;        int     i_best;        int x, y;        int i_pred_mode;        i_pred_mode= x264_mb_predict_intra4x4_mode( h, mb, idx );        x = block_idx_x[idx];        y = block_idx_y[idx];        p_src_by = p_src + 4 * x + 4 * y * i_src;        p_dst_by = p_dst + 4 * x + 4 * y * i_dst;        i_best = -1;        predict_4x4_mode_available( mb, idx, predict_mode, &i_max );        for( i = 0; i < i_max; i++ )        {            int i_sad;            int i_mode;            i_mode = predict_mode[i];            /* we do the prediction */            h->predict_4x4[i_mode]( p_dst_by, i_dst );            /* we calculate diff and get the square sum of the diff */            i_sad = h->pixf.satd[PIXEL_4x4]( p_dst_by, i_dst, p_src_by, i_src );            i_sad += res->i_lambda * (i_pred_mode == x264_mb_pred_mode4x4_fix[i_mode] ? 1 : 4);            /* if i_score is lower it is better */            if( i_best == -1 || i_best > i_sad )            {                res->i_predict4x4[x][y] = i_mode;                i_best = i_sad;            }        }        res->i_sad_i4x4 += i_best;        /* we need to encode this mb now (for next ones) */        mb->block[idx].i_intra4x4_pred_mode = res->i_predict4x4[x][y];        h->predict_4x4[res->i_predict4x4[x][y]]( p_dst_by, i_dst );        x264_mb_encode_i4x4( h, mb, idx, res->i_qp );    }    res->i_sad_i4x4 += res->i_lambda * 24;    /* from JVT (SATD0) */}static void x264_mb_analyse_inter_p_p8x8( x264_t *h, x264_macroblock_t *mb, x264_mb_analysis_t *res ){    x264_mb_context_t *ctx = mb->context;    int i_ref = res->i_ref_p16x16;    uint8_t *p_fref = ctx->p_fref0[i_ref][0];    int      i_fref = ctx->i_fref0[i_ref][0];    uint8_t *p_img  = ctx->p_img[0];    int      i_img  = ctx->i_img[0];    int i;    res->i_ref_p8x8 = i_ref;    res->i_sad_p8x8 = 0;    mb->i_partition = D_8x8;    for( i = 0; i < 4; i++ )    {        static const int test8x8_mode[4] = { D_L0_8x8, D_L0_8x4, D_L0_4x8, D_L0_4x4 };        static const int test8x8_pix[4]  = { PIXEL_8x8, PIXEL_8x4, PIXEL_4x8, PIXEL_4x4 };        static const int test8x8_pos_x[4][4] = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 4, 0, 0 }, { 0, 4, 0, 4 } };        static const int test8x8_pos_y[4][4] = { { 0, 0, 0, 0 }, { 0, 4, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 4, 4 } };        int i_test;        int mvp[4][2];        int mv[4][2];        int x, y;        int i_sub;        int i_b_satd;        y = 8 * (i / 2);        x = 8 * (i % 2);        i_b_satd = -1;        i_test = 0;        /* FIXME as it's tooooooo slow test only 8x8 */        //for( i_test = 0; i_test < 4; i_test++ )        {            int i_satd;            i_satd = 0;            mb->i_sub_partition[i] = test8x8_mode[i_test];            for( i_sub = 0; i_sub < x264_mb_partition_count_table[test8x8_mode[i_test]]; i_sub++ )            {                x264_mb_predict_mv( mb, 0, i, i_sub, mvp[i_sub] );                mv[i_sub][0] = mvp[i_sub][0];                mv[i_sub][1] = mvp[i_sub][1];                i_satd += h->me( h,                                 &p_fref[(y+test8x8_pos_y[i_test][i_sub])*i_fref +x+test8x8_pos_x[i_test][i_sub]], i_fref,                                 &p_img[(y+test8x8_pos_y[i_test][i_sub])*i_img +x+test8x8_pos_x[i_test][i_sub]], i_img,                                 test8x8_pix[i_test],                                 res->i_lambda,                                 &mv[i_sub][0], &mv[i_sub][1] );            }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕国产精品一区二区| 成人自拍视频在线| 欧美人成免费网站| 亚洲一区二区欧美日韩 | 国产酒店精品激情| 亚洲成人av一区二区三区| 成人黄页毛片网站| 在线免费不卡电影| 伊人开心综合网| 石原莉奈一区二区三区在线观看| 91免费国产视频网站| 一本大道久久a久久综合婷婷| 国产精品欧美一区二区三区| 成人97人人超碰人人99| 综合久久久久久久| 欧美日韩久久久| 欧美国产日韩亚洲一区| 成人av免费在线观看| 亚洲国产精品人人做人人爽| 欧美久久久久中文字幕| 日本午夜精品一区二区三区电影| 欧美私模裸体表演在线观看| 日韩不卡一区二区三区| 另类小说一区二区三区| 国产精品热久久久久夜色精品三区 | 欧美日韩一区在线观看| 欧美视频中文字幕| 欧美一级黄色大片| 亚洲免费色视频| 777xxx欧美| 艳妇臀荡乳欲伦亚洲一区| 欧美一区午夜视频在线观看| 国产精品中文字幕一区二区三区| 欧美一a一片一级一片| 国产自产v一区二区三区c| 亚洲电影在线免费观看| 国产亚洲成av人在线观看导航| 亚洲成精国产精品女| 成人av电影在线播放| 久久综合久久鬼色中文字| 肉肉av福利一精品导航| 1000部国产精品成人观看| 蜜臀久久久久久久| 亚洲一区二区三区四区在线免费观看| 国产精品77777| 久久国产尿小便嘘嘘| 91精品国产欧美一区二区成人| 9久草视频在线视频精品| 国产自产高清不卡| 国产一区二区三区免费在线观看| 午夜国产不卡在线观看视频| 欧美中文字幕一区二区三区亚洲| ...xxx性欧美| 日本道色综合久久| 亚洲福利视频三区| 亚洲国产成人av网| 精品国产免费一区二区三区香蕉| 欧美高清dvd| 国产高清精品网站| 亚洲免费在线观看视频| 在线观看日韩一区| 欧美日韩国产小视频在线观看| 亚洲国产精品一区二区久久| 亚洲综合小说图片| 美日韩一区二区| 中文字幕中文乱码欧美一区二区| 成人黄色av网站在线| 欧美亚洲动漫精品| 久草热8精品视频在线观看| 欧美国产日韩在线观看| 欧美日韩国产综合视频在线观看| 国产综合久久久久久鬼色| 亚洲欧美福利一区二区| 欧美一个色资源| 成人黄色在线看| 日韩一区二区三区免费观看| 91社区在线播放| 欧美一区二区三区小说| 在线看国产一区二区| 丰满岳乱妇一区二区三区| 天堂一区二区在线免费观看| 狠狠色伊人亚洲综合成人| 色88888久久久久久影院按摩| 国产在线播精品第三| 欧美性感一类影片在线播放| 国产精品美女久久久久高潮| 欧美成人精品二区三区99精品| 国产精品久久久久精k8| 久久久久久久久久久黄色| 天天影视色香欲综合网老头| 一区二区三区在线视频免费| 国产白丝精品91爽爽久久| 国产成人夜色高潮福利影视| 日本美女视频一区二区| 91老师片黄在线观看| a级精品国产片在线观看| 欧美大片顶级少妇| 日韩精品1区2区3区| 欧美性高清videossexo| 91.麻豆视频| 美腿丝袜亚洲综合| 欧美精品一区二区在线观看| 久久久久久夜精品精品免费| 久久综合av免费| 中文字幕一区在线| 色婷婷综合视频在线观看| 亚洲无人区一区| 国产在线观看一区二区| www激情久久| 亚洲欧美另类久久久精品2019| 国产精品午夜久久| 国产suv精品一区二区883| 国产欧美精品一区| 亚洲成人免费在线| 日韩一区二区在线看片| 国产一区二区精品久久99| 激情小说亚洲一区| 亚洲天堂av老司机| 91精品国模一区二区三区| 国产一区二区三区电影在线观看| 国产精品动漫网站| 717成人午夜免费福利电影| 狠狠色丁香久久婷婷综合丁香| 中文字幕+乱码+中文字幕一区| 亚洲福利视频一区| 久久久久久一二三区| 欧美午夜在线观看| 亚洲日本免费电影| 国产a区久久久| 欧美a级理论片| 一区二区三区产品免费精品久久75| 一区二区三区.www| 久久精品人人做| 国内精品国产成人国产三级粉色| 1024亚洲合集| 国产精品国产三级国产三级人妇| 激情六月婷婷综合| 日本aⅴ亚洲精品中文乱码| 亚洲欧美中日韩| 1024亚洲合集| 亚洲人成网站色在线观看| 国产精品色哟哟| 不卡一区二区在线| 中文字幕一区三区| 亚洲精品一区二区三区福利| 3751色影院一区二区三区| 欧美系列一区二区| 在线亚洲+欧美+日本专区| 成人18精品视频| 91美女在线看| 日韩精品一区第一页| 图片区日韩欧美亚洲| 亚洲va欧美va国产va天堂影院| 一区二区三区国产精华| 91精品在线免费| 国产一区二区三区精品欧美日韩一区二区三区| 91精品在线观看入口| 91麻豆精品国产91久久久久久久久| 欧美这里有精品| 国产毛片精品国产一区二区三区| 精品在线免费视频| 亚洲视频精选在线| 亚洲高清免费视频| 毛片av一区二区| av在线不卡免费看| 欧美在线视频不卡| 国产大陆精品国产| 亚洲成a人片在线观看中文| 日本aⅴ免费视频一区二区三区| 久久精品99国产精品日本| 成人精品小蝌蚪| 欧美日韩不卡在线| 国产精品麻豆99久久久久久| 亚洲精品亚洲人成人网在线播放| 欧美日韩一本到| 国产99一区视频免费| 欧美日韩在线播放一区| 久久久精品tv| 日韩欧美一级片| 亚洲精品中文在线| 中文幕一区二区三区久久蜜桃| 欧美亚州韩日在线看免费版国语版| 欧美喷水一区二区| 亚洲人成精品久久久久| 狠狠色综合播放一区二区| 欧美怡红院视频| 国产精品国模大尺度视频| 麻豆一区二区99久久久久| 日本精品一级二级| 亚洲人午夜精品天堂一二香蕉| 日韩一区二区高清| 欧美午夜宅男影院| 色综合久久六月婷婷中文字幕| 99国产精品久久久久久久久久 | 不卡欧美aaaaa| 久久天天做天天爱综合色| 欧美成人猛片aaaaaaa| 视频一区免费在线观看| 欧美视频一区二| 丝袜亚洲精品中文字幕一区|