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

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

?? cavlc.c

?? 文件為H.264編解碼器 僅供參考 包括windows版本和DM642版本
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
/*****************************************************************************
 *
 *  T264 AVC CODEC
 *
 *  Copyright(C) 2004-2005 llcc <lcgate1@yahoo.com.cn>
 *               2004-2005 visionany <visionany@yahoo.com.cn>
 *
 *  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-1307 USA
 *
 ****************************************************************************/

 /*****************************************************************************
 * cavlc.c: from x 264
 *****************************************************************************/


//#include <stdlib.h>
//#include <string.h>
//#include <stdint.h>

#include <stdio.h>

#include "T264.h"
#include "vlc.h"
#include "bitstream.h"
#include "inter.h"
#include <assert.h>

static const uint8_t intra4x4_cbp_to_golomb[48]=
{
  3, 29, 30, 17, 31, 18, 37,  8, 32, 38, 19,  9, 20, 10, 11,  2,
 16, 33, 34, 21, 35, 22, 39,  4, 36, 40, 23,  5, 24,  6,  7,  1,
 41, 42, 43, 25, 44, 26, 46, 12, 45, 47, 27, 13, 28, 14, 15,  0
};
static const uint8_t inter_cbp_to_golomb[48]=
{
  0,  2,  3,  7,  4,  8, 17, 13,  5, 18,  9, 14, 10, 15, 16, 11,
  1, 32, 33, 36, 34, 37, 44, 40, 35, 45, 38, 41, 39, 42, 43, 19,
  6, 24, 25, 20, 26, 21, 46, 28, 27, 47, 22, 29, 23, 30, 31, 12
};

/*
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
};
static const uint8_t block_idx_xy[4][4] =
{
    { 0, 2, 8,  10},
    { 1, 3, 9,  11},
    { 4, 6, 12, 14},
    { 5, 7, 13, 15}
};
*/

#define IS_DIRECT(x) (x == B_DIRECT_16x16 || x == B_DIRECT_8x8)
#define BLOCK_INDEX_CHROMA_DC   (-1)
#define BLOCK_INDEX_LUMA_DC     (-2)

static __inline void eg_write_vlc(bs_t* bs, vlc_t v)
{
	eg_write_direct(bs, v.i_bits & ((uint32_t)~0 >> (uint32_t)(32 - v.i_size)), v.i_size);
}

int8_t
T264_mb_predict_intra4x4_mode(T264_t *t, int32_t idx)
{
	int32_t x, y;
	int8_t nA, nB, pred_blk;

    x = luma_inverse_x[idx];
    y = luma_inverse_y[idx];

    nA = t->mb.i4x4_pred_mode_ref[IPM_LUMA + x + y * 8 - 1];
    nB = t->mb.i4x4_pred_mode_ref[IPM_LUMA + x + y * 8 - 8];
	
    pred_blk  = T264_MIN(nA, nB);

    if( pred_blk < 0 )
        return Intra_4x4_DC;

    return pred_blk;	
}

uint8_t 
T264_mb_predict_non_zero_code(T264_t* t, int idx)
{	
    int32_t x, y;
    int32_t nA, nB;
	int16_t pred_blk;

	if(idx >= 0 && idx < 16)
	{
        x = luma_inverse_x[idx];
        y = luma_inverse_y[idx];
        nA = t->mb.nnz_ref[NNZ_LUMA + x + y * 8 - 1];
        nB = t->mb.nnz_ref[NNZ_LUMA + x + y * 8 - 8];
	}
	else if(idx < 20)
	{
		y = (idx - 16) / 2;
		x = (idx - 16) % 2;
        nA = t->mb.nnz_ref[NNZ_CHROMA0 + x + y * 8 - 1];
        nB = t->mb.nnz_ref[NNZ_CHROMA0 + x + y * 8 - 8];
	}
	else if(idx < 24)
	{
        y = (idx - 20) / 2;
        x = (idx - 20) % 2;
        nA = t->mb.nnz_ref[NNZ_CHROMA1 + x + y * 8 - 1];
        nB = t->mb.nnz_ref[NNZ_CHROMA1 + x + y * 8 - 8];
	}
	
    pred_blk = nA + nB;

    if( pred_blk < 0x80 )
    {
        pred_blk = ( pred_blk + 1 ) >> 1;
    }
    return pred_blk & 0x7f;
}

/****************************************************************************
 * block_residual_write_cavlc
 ****************************************************************************/
static void block_residual_write_cavlc( T264_t *h, int32_t i_idx, int16_t *l, int32_t i_count )
{
    int level[16], run[16];
    int i_total, i_trailing;
    int i_total_zero;
    int i_last;
    unsigned int i_sign;

    int i;
    int i_zero_left;
    int i_suffix_length;

    /* first find i_last */
    i_last = i_count - 1;
    while( i_last >= 0 && l[i_last] == 0 )
    {
        i_last--;
    }

    i_sign = 0;
    i_total = 0;
    i_trailing = 0;
    i_total_zero = 0;

    if( i_last >= 0 )
    {
        int b_trailing = 1;
        int idx = 0;

        /* level and run and total */
        while( i_last >= 0 )
        {
            level[idx] = l[i_last--];

            run[idx] = 0;
            while( i_last >= 0 && l[i_last] == 0 )
            {
                run[idx]++;
                i_last--;
            }

            i_total++;
            i_total_zero += run[idx];

            if( b_trailing && ABS( level[idx] ) == 1 && i_trailing < 3 )
            {
                i_sign <<= 1;
                if( level[idx] < 0 )
                {
                    i_sign |= 0x01;
                }

                i_trailing++;
            }
            else
            {
                b_trailing = 0;
            }

            idx++;
        }
    }

    /* total/trailing represented by Coeff_token (5 tables)*/
    if( i_idx == BLOCK_INDEX_CHROMA_DC )
    {
		eg_write_vlc(h->bs, x264_coeff_token[4][i_total*4+i_trailing]);
    }
    else
    {
        /* T264_mb_predict_non_zero_code return 0 <-> (16+16+1)>>1 = 16 */
        static const int ct_index[17] = {0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,3 };
        int nC = 0;

        if( i_idx == BLOCK_INDEX_LUMA_DC )
        {
			// predict nC = (nA + nB) / 2;
            nC = T264_mb_predict_non_zero_code(h, 0);
        }
        else
        {
			// predict nC = (nA + nB) / 2;
            nC = T264_mb_predict_non_zero_code(h, i_idx);
        }

		eg_write_vlc(h->bs, x264_coeff_token[ct_index[nC]][i_total*4+i_trailing]);
    }

    if( i_total <= 0 )
    {
        return;
    }

	//encoding trailing '1's (max = 3)
    i_suffix_length = i_total > 10 && i_trailing < 3 ? 1 : 0;
    if( i_trailing > 0 )
    {
		eg_write_direct(h->bs, i_sign & ((uint32_t)~0 >> (uint32_t)(32 - i_trailing)), i_trailing);
    }

	//encoding remain levels of non-zero coefficients (prefix + suffix)
    for( i = i_trailing; i < i_total; i++ )
    {
        int i_level_code;

        /* calculate level code */
        if( level[i] < 0 )
        {
            i_level_code = -2*level[i] - 1;
        }
        else /* if( level[i] > 0 ) */
        {
            i_level_code = 2 * level[i] - 2;
        }
        if( i == i_trailing && i_trailing < 3 )
        {
            i_level_code -=2; /* as level[i] can't be 1 for the first one if i_trailing < 3 */
        }

        if( ( i_level_code >> i_suffix_length ) < 14 )
        {
            eg_write_vlc(h->bs, x264_level_prefix[i_level_code >> i_suffix_length]);
            if( i_suffix_length > 0 )
            {
				eg_write_direct(h->bs, (uint32_t)i_level_code & ((uint32_t)~0 >> (uint32_t)(32 - i_suffix_length)), i_suffix_length);
            }
        }
        else if( i_suffix_length == 0 && i_level_code < 30 )
        {
            eg_write_vlc(h->bs, x264_level_prefix[14]);
            eg_write_direct(h->bs, (i_level_code - 14) & ((uint32_t)~0 >> (uint32_t)(32 - 4)), 4);
        }
        else if( i_suffix_length > 0 && ( i_level_code >> i_suffix_length ) == 14 )
        {
            eg_write_vlc(h->bs, x264_level_prefix[14]);
            eg_write_direct(h->bs, i_level_code & ((uint32_t)~0 >> (uint32_t)(32 - i_suffix_length)), i_suffix_length);
        }
        else
        {
            eg_write_vlc(h->bs, x264_level_prefix[15]);
            i_level_code -= 15 << i_suffix_length;
            if( i_suffix_length == 0 )
            {
                i_level_code -= 15;
            }

            if( i_level_code >= ( 1 << 12 ) || i_level_code < 0 )
            {
                fprintf( stderr, "OVERFLOW levelcode=%d\n", i_level_code );
            }

			eg_write_direct(h->bs, i_level_code & ((uint32_t)~0 >> (uint32_t)(32 - 12)), 12);
        }

        if( i_suffix_length == 0 )
        {
            i_suffix_length++;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美又粗又大又爽| 亚洲电影视频在线| 精品国产一区二区精华| 欧美日韩高清不卡| 欧美视频一区二区在线观看| 欧美视频一二三区| 欧美视频一区二区三区在线观看| 欧美色涩在线第一页| 欧美午夜精品一区| 欧美日韩你懂的| 欧美一区二区三区免费观看视频| 91精品麻豆日日躁夜夜躁| 日韩午夜中文字幕| 久久影院电视剧免费观看| 久久久精品国产99久久精品芒果| 久久久久99精品一区| 国产精品久久久久久久久久免费看| 国产精品天天摸av网| ...xxx性欧美| 亚洲国产日韩一区二区| 亚洲成人一区二区| 激情综合亚洲精品| www.av精品| 欧美中文一区二区三区| 制服丝袜激情欧洲亚洲| 337p粉嫩大胆色噜噜噜噜亚洲 | 中文字幕中文乱码欧美一区二区| 国产精品国产精品国产专区不蜜| 亚洲免费av网站| 天堂久久一区二区三区| 国产精品综合二区| 91丨porny丨最新| 欧美理论在线播放| 久久一区二区视频| 亚洲视频免费在线| 石原莉奈一区二区三区在线观看| 精品一区二区三区在线播放| 国产99久久久国产精品潘金 | 欧美军同video69gay| 2019国产精品| 亚洲老妇xxxxxx| 青草av.久久免费一区| 国产精品亚洲成人| 在线观看不卡一区| 久久人人超碰精品| 洋洋av久久久久久久一区| 蜜臀av一级做a爰片久久| 成人精品免费视频| 欧美日韩电影一区| 中文字幕av一区二区三区免费看| 亚洲午夜久久久久中文字幕久| 久久精品国产澳门| 在线免费观看日本一区| 久久众筹精品私拍模特| 亚洲一区二区三区中文字幕在线| 黄色资源网久久资源365| 色综合久久久久久久久| 2020国产精品久久精品美国| 亚洲一区二区三区视频在线播放| 国产黄色成人av| 欧美挠脚心视频网站| 中文一区在线播放| 免费观看成人鲁鲁鲁鲁鲁视频| 91在线小视频| 国产欧美一区视频| 久久国产婷婷国产香蕉| 91福利国产精品| 中文字幕免费在线观看视频一区| 日韩电影一区二区三区| 色天天综合色天天久久| 久久久久亚洲蜜桃| 轻轻草成人在线| 欧美又粗又大又爽| 日韩久久一区二区| 国产成人精品免费网站| 日韩午夜激情免费电影| 亚洲一区二区黄色| 色婷婷久久久久swag精品| 欧美极品美女视频| 极品少妇一区二区三区精品视频 | 亚洲国产婷婷综合在线精品| 成人高清视频免费观看| 2020国产精品| 韩国一区二区三区| 69堂成人精品免费视频| 亚洲一区视频在线| 色婷婷综合久久久| 亚洲欧美日韩国产一区二区三区| 国产成人综合网| 久久精品一区二区| 国产中文一区二区三区| 日韩免费成人网| 久久国产剧场电影| 日韩一区二区免费在线电影| 视频一区视频二区中文字幕| 欧美性大战久久| 亚洲午夜羞羞片| 欧美日韩国产美女| 亚洲成人av一区| 制服丝袜亚洲色图| 蜜桃久久精品一区二区| 欧美一区二区三区在线看| 日本不卡不码高清免费观看| 制服丝袜av成人在线看| 日韩成人伦理电影在线观看| 69堂国产成人免费视频| 美女一区二区在线观看| 日韩美女在线视频| 精品影视av免费| 久久久久久一级片| 成人av电影在线网| 亚洲视频电影在线| 在线精品视频一区二区| 天堂午夜影视日韩欧美一区二区| 欧美疯狂性受xxxxx喷水图片| 日韩影院精彩在线| 精品久久久久久久久久久久包黑料 | 日韩三级精品电影久久久 | 色哟哟精品一区| 亚洲自拍都市欧美小说| 欧美日韩成人综合在线一区二区| 日韩av一区二| 久久综合99re88久久爱| av在线不卡电影| 亚洲综合色丁香婷婷六月图片| 欧美日韩五月天| 久久精品国产精品亚洲红杏| 国产欧美精品一区aⅴ影院 | 久久夜色精品国产欧美乱极品| 国产成人啪午夜精品网站男同| 国产精品福利电影一区二区三区四区 | www.欧美日韩国产在线| 亚洲国产欧美在线人成| 日韩欧美成人激情| 国产成人精品免费一区二区| 亚洲精品乱码久久久久久黑人 | 午夜成人在线视频| 精品久久人人做人人爰| 成人免费不卡视频| 性感美女久久精品| 国产偷国产偷精品高清尤物| 91福利社在线观看| 韩国女主播成人在线| 亚洲欧美综合另类在线卡通| 欧美日本高清视频在线观看| 国产精品自拍一区| 一区二区三区在线影院| 亚洲精品一区在线观看| 99久久99久久综合| 毛片基地黄久久久久久天堂| 国产精品欧美一区喷水| 欧美高清hd18日本| 成人开心网精品视频| 日本欧美一区二区| 国产精品福利一区| 欧美mv日韩mv亚洲| 在线欧美日韩国产| 国产盗摄精品一区二区三区在线| 亚洲一区二区三区视频在线 | 精品一区二区三区在线播放视频| 日韩一区有码在线| 欧美成人伊人久久综合网| 色综合久久久久综合体桃花网| 久久99精品国产| 亚洲一区二区av电影| 亚洲国产成人私人影院tom| 91精品国产综合久久久蜜臀图片| 不卡的av电影在线观看| 免费成人在线影院| 一区二区三区在线视频免费 | 亚洲va中文字幕| 国产精品嫩草99a| 精品捆绑美女sm三区| 欧美日韩精品一区视频| 白白色 亚洲乱淫| 国内成人免费视频| 亚洲一区二区在线免费看| 综合久久久久综合| 中文字幕乱码日本亚洲一区二区| 欧美一区二区三区四区五区| 日本大香伊一区二区三区| 成人精品免费视频| 国产成人在线视频网址| 久久精品99久久久| 奇米影视一区二区三区小说| 午夜免费久久看| 亚洲黄色性网站| 综合色中文字幕| 国产精品精品国产色婷婷| 久久精品这里都是精品| 精品国产麻豆免费人成网站| 欧美一区二区三区四区五区| 欧美日高清视频| 欧洲一区在线电影| 91视频91自| 97se亚洲国产综合自在线| www.日韩精品| 99精品久久只有精品| 国产不卡视频在线播放| 国产精品影视在线观看|