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

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

?? enmacroblock.c

?? x264 encoder in TI ccs.
?? C
字號:
/*****************************************************************************
 * macroblock.c: h264 encoder library
 *****************************************************************************
 * Copyright (C) 2003 Laurent Aimar
 * $Id: macroblock.c,v 1.1 2004/06/03 19:27:08 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"
#include "enmacroblock.h"


/* def_quant4_mf only for probe_skip; actual encoding uses matrices from set.c */
/* FIXME this seems to make better decisions with cqm=jvt, but could screw up
 * with general custom matrices. */
static const int def_quant4_mf[6][4][4] =
{
    { { 13107, 8066, 13107, 8066 }, { 8066, 5243, 8066, 5243 },
      { 13107, 8066, 13107, 8066 }, { 8066, 5243, 8066, 5243 } },
    { { 11916, 7490, 11916, 7490 }, { 7490, 4660, 7490, 4660 },
      { 11916, 7490, 11916, 7490 }, { 7490, 4660, 7490, 4660 } },
    { { 10082, 6554, 10082, 6554 }, { 6554, 4194, 6554, 4194 },
      { 10082, 6554, 10082, 6554 }, { 6554, 4194, 6554, 4194 } },
    { {  9362, 5825,  9362, 5825 }, { 5825, 3647, 5825, 3647 },
      {  9362, 5825,  9362, 5825 }, { 5825, 3647, 5825, 3647 } },
    { {  8192, 5243,  8192, 5243 }, { 5243, 3355, 5243, 3355 },
      {  8192, 5243,  8192, 5243 }, { 5243, 3355, 5243, 3355 } },
    { {  7282, 4559,  7282, 4559 }, { 4559, 2893, 4559, 2893 },
      {  7282, 4559,  7282, 4559 }, { 4559, 2893, 4559, 2893 } }
};

/****************************************************************************
 * Scan and Quant functions
 ****************************************************************************/

#define ZIG(i,y,x) level[i] = dct[x][y];
static inline void scan_zigzag_8x8full( int level[64], int16_t dct[8][8] )
{
    ZIG( 0,0,0) ZIG( 1,0,1) ZIG( 2,1,0) ZIG( 3,2,0)
    ZIG( 4,1,1) ZIG( 5,0,2) ZIG( 6,0,3) ZIG( 7,1,2)
    ZIG( 8,2,1) ZIG( 9,3,0) ZIG(10,4,0) ZIG(11,3,1)
    ZIG(12,2,2) ZIG(13,1,3) ZIG(14,0,4) ZIG(15,0,5)
    ZIG(16,1,4) ZIG(17,2,3) ZIG(18,3,2) ZIG(19,4,1)
    ZIG(20,5,0) ZIG(21,6,0) ZIG(22,5,1) ZIG(23,4,2)
    ZIG(24,3,3) ZIG(25,2,4) ZIG(26,1,5) ZIG(27,0,6)
    ZIG(28,0,7) ZIG(29,1,6) ZIG(30,2,5) ZIG(31,3,4)
    ZIG(32,4,3) ZIG(33,5,2) ZIG(34,6,1) ZIG(35,7,0)
    ZIG(36,7,1) ZIG(37,6,2) ZIG(38,5,3) ZIG(39,4,4)
    ZIG(40,3,5) ZIG(41,2,6) ZIG(42,1,7) ZIG(43,2,7)
    ZIG(44,3,6) ZIG(45,4,5) ZIG(46,5,4) ZIG(47,6,3)
    ZIG(48,7,2) ZIG(49,7,3) ZIG(50,6,4) ZIG(51,5,5)
    ZIG(52,4,6) ZIG(53,3,7) ZIG(54,4,7) ZIG(55,5,6)
    ZIG(56,6,5) ZIG(57,7,4) ZIG(58,7,5) ZIG(59,6,6)
    ZIG(60,5,7) ZIG(61,6,7) ZIG(62,7,6) ZIG(63,7,7)
}
static inline void scan_zigzag_4x4full( int level[16], int16_t dct[4][4] )
{
    ZIG( 0,0,0) ZIG( 1,0,1) ZIG( 2,1,0) ZIG( 3,2,0)
    ZIG( 4,1,1) ZIG( 5,0,2) ZIG( 6,0,3) ZIG( 7,1,2)
    ZIG( 8,2,1) ZIG( 9,3,0) ZIG(10,3,1) ZIG(11,2,2)
    ZIG(12,1,3) ZIG(13,2,3) ZIG(14,3,2) ZIG(15,3,3)
}
static inline void scan_zigzag_4x4( int level[15], int16_t dct[4][4] )
{
                ZIG( 0,0,1) ZIG( 1,1,0) ZIG( 2,2,0)
    ZIG( 3,1,1) ZIG( 4,0,2) ZIG( 5,0,3) ZIG( 6,1,2)
    ZIG( 7,2,1) ZIG( 8,3,0) ZIG( 9,3,1) ZIG(10,2,2)
    ZIG(11,1,3) ZIG(12,2,3) ZIG(13,3,2) ZIG(14,3,3)
}
static inline void scan_zigzag_2x2_dc( int level[4], int16_t dct[2][2] )
{
    ZIG(0,0,0)
    ZIG(1,0,1)
    ZIG(2,1,0)
    ZIG(3,1,1)
}
#undef ZIG

#define ZIG(i,y,x) {\
    int oe = x+y*FENC_STRIDE;\
    int od = x+y*FDEC_STRIDE;\
    level[i] = p_src[oe] - p_dst[od];\
    p_dst[od] = p_src[oe];\
}
static inline void sub_zigzag_4x4full( int level[16], const uint8_t *p_src, uint8_t *p_dst )
{
    ZIG( 0,0,0) ZIG( 1,0,1) ZIG( 2,1,0) ZIG( 3,2,0)
    ZIG( 4,1,1) ZIG( 5,0,2) ZIG( 6,0,3) ZIG( 7,1,2)
    ZIG( 8,2,1) ZIG( 9,3,0) ZIG(10,3,1) ZIG(11,2,2)
    ZIG(12,1,3) ZIG(13,2,3) ZIG(14,3,2) ZIG(15,3,3)
}
static inline void sub_zigzag_4x4( int level[15], const uint8_t *p_src, uint8_t *p_dst )
{
                ZIG( 0,0,1) ZIG( 1,1,0) ZIG( 2,2,0)
    ZIG( 3,1,1) ZIG( 4,0,2) ZIG( 5,0,3) ZIG( 6,1,2)
    ZIG( 7,2,1) ZIG( 8,3,0) ZIG( 9,3,1) ZIG(10,2,2)
    ZIG(11,1,3) ZIG(12,2,3) ZIG(13,3,2) ZIG(14,3,3)
}
#undef ZIG

static void quant_8x8( x264_t *h, int16_t dct[8][8], int quant_mf[6][8][8], int i_qscale, int b_intra )
{
    const int i_qbits = 16 + i_qscale / 6;
    const int i_mf = i_qscale % 6;
    const int f = ( 1 << i_qbits ) / ( b_intra ? 3 : 6 );
    h->quantf.quant_8x8_core( dct, quant_mf[i_mf], i_qbits, f );
}
static void quant_4x4( x264_t *h, int16_t dct[4][4], int quant_mf[6][4][4], int i_qscale, int b_intra )
{
    const int i_qbits = 15 + i_qscale / 6;
    const int i_mf = i_qscale % 6;
    const int f = ( 1 << i_qbits ) / ( b_intra ? 3 : 6 );
    h->quantf.quant_4x4_core( dct, quant_mf[i_mf], i_qbits, f );
}
static void quant_4x4_dc( x264_t *h, int16_t dct[4][4], int quant_mf[6][4][4], int i_qscale )
{
    const int i_qbits = 16 + i_qscale / 6;
    const int i_mf = i_qscale % 6;
    const int f = ( 1 << i_qbits ) / 3;
    h->quantf.quant_4x4_dc_core( dct, quant_mf[i_mf][0][0], i_qbits, f );
}
static void quant_2x2_dc( x264_t *h, int16_t dct[2][2], int quant_mf[6][4][4], int i_qscale, int b_intra )
{
    const int i_qbits = 16 + i_qscale / 6;
    const int i_mf = i_qscale % 6;
    const int f = ( 1 << i_qbits ) / ( b_intra ? 3 : 6 );
    h->quantf.quant_2x2_dc_core( dct, quant_mf[i_mf][0][0], i_qbits, f );
}

/* (ref: JVT-B118)
 * x264_mb_decimate_score: given dct coeffs it returns a score to see if we could empty this dct coeffs
 * to 0 (low score means set it to null)
 * Used in inter macroblock (luma and chroma)
 *  luma: for a 8x8 block: if score < 4 -> null
 *        for the complete mb: if score < 6 -> null
 *  chroma: for the complete mb: if score < 7 -> null
 */
static int x264_mb_decimate_score( int *dct, int i_max )
{
    static const int i_ds_table4[16] = {
        3,2,2,1,1,1,0,0,0,0,0,0,0,0,0,0 };
    static const int i_ds_table8[64] = {
        3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,
        1,1,1,1,1,1,1,1,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 };

    const int *ds_table = (i_max == 64) ? i_ds_table8 : i_ds_table4;
    int i_score = 0;
    int idx = i_max - 1;

    while( idx >= 0 && dct[idx] == 0 )
        idx--;

    while( idx >= 0 )
    {
        int i_run;

        if( abs( dct[idx--] ) > 1 )
            return 9;

        i_run = 0;
        while( idx >= 0 && dct[idx] == 0 )
        {
            idx--;
            i_run++;
        }
        i_score += ds_table[i_run];
    }

    return i_score;
}

void x264_mb_encode_i4x4( x264_t *h, int idx, int i_qscale )
{
    int x = 4 * block_idx_x[idx];
    int y = 4 * block_idx_y[idx];
    uint8_t *p_src = &h->mb.pic.p_fenc[0][x+y*FENC_STRIDE];
    uint8_t *p_dst = &h->mb.pic.p_fdec[0][x+y*FDEC_STRIDE];
    int16_t dct4x4[4][4];

    if( h->mb.b_lossless )
    {
        sub_zigzag_4x4full( h->dct.block[idx].luma4x4, p_src, p_dst );
        return;
    }

    h->dctf.sub4x4_dct( dct4x4, p_src, p_dst );//癸4*4

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91综合网| 国产一区二区三区精品欧美日韩一区二区三区 | 久久蜜桃av一区精品变态类天堂| 欧洲一区二区三区在线| 97精品国产露脸对白| 成人爽a毛片一区二区免费| 国产在线看一区| 韩国三级电影一区二区| 久久激情五月婷婷| 另类小说色综合网站| 日韩福利电影在线| 日韩专区一卡二卡| 日本不卡一二三区黄网| 午夜久久电影网| 日韩在线卡一卡二| 午夜久久久影院| 日韩电影在线一区二区| 看电影不卡的网站| 国精产品一区一区三区mba视频 | 欧美va亚洲va香蕉在线| 日韩欧美亚洲一区二区| 精品美女一区二区| 久久精品日韩一区二区三区| 国产精品欧美久久久久无广告 | 成人免费视频播放| 91网上在线视频| 欧美在线色视频| 欧美一区二区三区视频免费播放| 日韩三级免费观看| 国产片一区二区三区| 国产精品妹子av| 亚洲午夜激情网页| 久久99精品国产麻豆婷婷| 国产高清无密码一区二区三区| 成人小视频免费观看| 色综合久久精品| 日韩亚洲欧美一区二区三区| 国产欧美一二三区| 亚洲午夜一区二区三区| 激情综合色综合久久综合| 成人免费的视频| 欧美日韩成人综合天天影院 | 日韩av不卡一区二区| 久久国产精品无码网站| 91精品国产综合久久久久久久久久| 欧美福利视频导航| 欧美激情一区二区三区全黄 | 在线免费观看成人短视频| 欧美一区二区三区四区在线观看| 国产欧美一区视频| 日本欧美肥老太交大片| 99亚偷拍自图区亚洲| 日韩免费成人网| 亚洲女女做受ⅹxx高潮| 国产麻豆视频精品| 欧美一级二级三级蜜桃| 亚洲欧洲在线观看av| 精品在线亚洲视频| 欧美日韩三级视频| 国产精品传媒在线| 精彩视频一区二区三区| 欧美在线观看一二区| 国产精品视频一区二区三区不卡| 婷婷亚洲久悠悠色悠在线播放 | 国产精品国产自产拍高清av| 日韩成人精品视频| 在线观看视频一区二区| 国产精品麻豆视频| 国产精品一区一区三区| 欧美变态tickling挠脚心| 亚洲成人免费在线观看| 日本韩国一区二区三区| 国产精品乱人伦| 国产一二精品视频| 欧美va亚洲va| 精品亚洲欧美一区| 日韩你懂的在线播放| 蜜臀国产一区二区三区在线播放| 欧美日韩一区二区三区视频| 亚洲综合男人的天堂| 在线观看日韩一区| 亚洲精品乱码久久久久久黑人| 99热国产精品| 亚洲色图欧美激情| 91国偷自产一区二区三区成为亚洲经典 | 91精品麻豆日日躁夜夜躁| 亚洲大片免费看| 欧美日韩在线三级| 爽好久久久欧美精品| 日韩一区二区免费视频| 日韩影视精彩在线| 日韩欧美一区中文| 国产自产v一区二区三区c| 精品乱人伦小说| 国产精品 日产精品 欧美精品| 国产亚洲综合av| 日韩欧美国产电影| 国产精品一区二区三区乱码| 日本一区二区三区久久久久久久久不| 国产福利精品一区| 综合婷婷亚洲小说| 欧美日韩电影一区| 韩日精品视频一区| 国产精品久久久久精k8 | 26uuu另类欧美亚洲曰本| 韩国成人福利片在线播放| 国产午夜亚洲精品午夜鲁丝片| 岛国精品在线播放| 亚洲黄网站在线观看| 欧美一级久久久| 国产成人超碰人人澡人人澡| 亚洲激情在线播放| 日韩一区二区三区电影在线观看| 国产精品一区二区你懂的| 亚洲视频在线一区二区| 91精品国产aⅴ一区二区| 国产a区久久久| 亚洲一二三区不卡| 精品福利一区二区三区免费视频| 成人免费高清在线| 人人超碰91尤物精品国产| 中文字幕精品一区| 4438成人网| 成人av在线资源| 蜜臀99久久精品久久久久久软件| 国产精品理论在线观看| 在线综合视频播放| 91美女福利视频| 久久99精品国产| 亚洲一区二区在线免费观看视频 | 欧美一区二区三区在线观看视频| 高清beeg欧美| 麻豆精品在线播放| 亚洲一区电影777| 国产日产欧产精品推荐色 | 轻轻草成人在线| 1区2区3区精品视频| 精品精品欲导航| 欧美性一区二区| av成人动漫在线观看| 国产一区视频在线看| 亚洲成人av中文| 亚洲欧洲中文日韩久久av乱码| 日韩你懂的电影在线观看| 欧美天天综合网| 色综合天天综合给合国产| 国产成人欧美日韩在线电影| 91免费版在线看| 成人午夜在线免费| 国产精品996| 国产激情视频一区二区在线观看| 天天操天天干天天综合网| 亚洲一区在线观看网站| 亚洲丝袜制服诱惑| 国产精品情趣视频| 久久精品人人做人人爽人人| 精品国产电影一区二区 | 免费美女久久99| 天堂久久一区二区三区| 亚洲一区二区在线免费观看视频| 亚洲久草在线视频| 亚洲精品综合在线| 亚洲精品视频一区二区| 亚洲男女毛片无遮挡| 一区二区成人在线| 一区二区成人在线| 亚洲国产精品久久人人爱| 亚洲一二三四在线| 婷婷中文字幕一区三区| 日韩成人免费电影| 久久99国内精品| 国产精品一级在线| 成人综合婷婷国产精品久久免费| 成人午夜电影小说| 91在线丨porny丨国产| 欧美亚洲国产bt| 日韩一区二区三区在线视频| 日韩亚洲欧美一区| 国产欧美中文在线| 18欧美乱大交hd1984| 性做久久久久久久久| 日韩成人精品在线| 国产精品一区二区久激情瑜伽| 成人深夜在线观看| 在线欧美小视频| 精品国产一二三区| 亚洲欧洲精品一区二区精品久久久 | 欧美一区日本一区韩国一区| 欧美成人艳星乳罩| 亚洲欧洲韩国日本视频| 午夜精品成人在线视频| 国产九九视频一区二区三区| 一本高清dvd不卡在线观看| 欧美浪妇xxxx高跟鞋交| 国产亚洲美州欧州综合国| 亚洲精品免费在线播放| 韩国中文字幕2020精品| 色婷婷激情综合| 日韩女优视频免费观看| 亚洲视频中文字幕|