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

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

?? decoder_new.c

?? 另一個版本的x264的decoder
?? C
?? 第 1 頁 / 共 3 頁
字號:
/***************************************************************************** * x264: h264 decoder ***************************************************************************** * Copyright (C) 2003 Laurent Aimar * $Id: decoder.c,v 1.1 2004/06/03 19:27:07 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_x264.h"#include <limits.h>#include "common.h"#include "set.h"#include "macroblock.h"#include "vlc.h"#include "assert.h"static void x264_update_ref_list( x264_t *h ){int i, j;    	for( i = 0, j = 0; i < h->dpb.used_size; i++ )	{		if (h->dpb.fs[i]->is_reference && !h->dpb.fs[i]->is_long_ref)		{			h->short_ref[j++] = h->dpb.fs[i];		}	}	h->short_ref_count = j;	while ( j < h->dpb.size )	{		h->short_ref[j++] = NULL;	}		for( i = 0, j = 0; i < h->dpb.used_size; i++ )		{			if (h->dpb.fs[i]->is_reference &&  h->dpb.fs[i]->is_long_ref)			{				h->long_ref[j++] = h->dpb.fs[i];			}		}			h->long_ref_count = j;		while ( j < h->dpb.size )		{			h->long_ref[j++] = NULL;		}}/*! ************************************************************************ * \brief *    Perform Sliding window decoded reference picture marking process * ************************************************************************ */static void sliding_window_memory_management( x264_t *h ){	int i;	// if this is a reference pic with sliding sliding window, unmark first ref frame	if (h->short_ref_count == h->sps->i_num_ref_frames - h->long_ref_count)	{		for (i = 0; i < h->dpb.used_size; i++)		{			if (h->dpb.fs[i]->is_reference  && (!(h->dpb.fs[i]->is_long_ref)))			{				h->dpb.fs[i]->is_reference = 0;				x264_update_ref_list( h );				break;			}		}	}}static int x264_bulid_ref_list( x264_t *h ){	int b_ok;    int i, list0idx;	int ref_num = 0;		/* build ref list 0/1 */    h->i_ref0 = 0;    h->i_ref1 = 0;	if( h->sh.i_type == SLICE_TYPE_P )	{		for( i = 0; i < h->short_ref_count; i++ )		{			if( h->short_ref[i]->i_poc >= 0 )			{				h->fref0[ref_num++] = h->short_ref[i];			}		}		/* Order ref0 from higher to lower poc */		do		{			b_ok = 1;			for( i = 0; i < ref_num - 1; i++ )			{				if( h->fref0[i]->i_poc < h->fref0[i+1]->i_poc )				{					x264_frame_t *tmp = h->fref0[i+1];					h->fref0[i+1] = h->fref0[i];					h->fref0[i] = tmp;					b_ok = 0;					break;				}			}		} while( !b_ok );		h->i_ref0 = ref_num;	}	else if( h->sh.i_type == SLICE_TYPE_B )	{		for( i = 0; i < h->short_ref_count; i++ )		{			if( h->short_ref[i]->i_poc >= 0 )			{				if( h->short_ref[i]->i_poc < h->fdec->i_poc )				{					h->fref0[ref_num++] = h->short_ref[i];				}			}		}		list0idx = ref_num;		for( i = 0; i < h->short_ref_count; i++ )		{			if( h->short_ref[i]->i_poc >= 0 )			{				if( h->short_ref[i]->i_poc > h->fdec->i_poc )				{					h->fref0[ref_num++] = h->short_ref[i];				}			}		}		/* Order ref0 from higher to lower poc for pictures with POC smaller than current POC		   then order ref0 from lower to higher poc for pictures with POC larger than current POC*/				do		{			b_ok = 1;			for( i = 0; i < list0idx - 1; i++ )			{				if( h->fref0[i]->i_poc < h->fref0[i+1]->i_poc )				{					x264_frame_t *tmp = h->fref0[i+1];					h->fref0[i+1] = h->fref0[i];					h->fref0[i] = tmp;					b_ok = 0;					break;				}			}		} while( !b_ok );				do		{			b_ok = 1;			for( i = list0idx; i < ref_num - 1; i++ )			{				if( h->fref0[i]->i_poc > h->fref0[i+1]->i_poc )				{					x264_frame_t *tmp = h->fref0[i+1];					h->fref0[i+1] = h->fref0[i];					h->fref0[i] = tmp;					b_ok = 0;					break;				}			}		} while( !b_ok );		/* initial ref1 */		for (i = 0; i < list0idx; i++)		{			h->fref1[ref_num - list0idx + i] = h->fref0[i];		}		for (i = list0idx; i < ref_num; i++)		{			h->fref1[i - list0idx] = h->fref0[i];		}		h->i_ref0 = ref_num;		h->i_ref1 = ref_num;	}	if( h->i_ref0 > h->sh.i_num_ref_idx_l0_active )    {        h->i_ref0 = h->sh.i_num_ref_idx_l0_active;    }    if( h->i_ref1 > h->sh.i_num_ref_idx_l1_active )    {        h->i_ref1 = h->sh.i_num_ref_idx_l1_active;    }    //fprintf( stderr,"POC:%d ref0=%d POC0=%d\n", h->fdec->i_poc, h->i_ref0, h->i_ref0 > 0 ? h->fref0[0]->i_poc : -1 );	return 0;}static void x264_slice_idr( x264_t *h ){    int i;    h->i_poc_msb = 0;    h->i_poc_lsb = 0;    h->i_frame_offset = 0;    h->i_frame_num = 0;		for( i = 0; i < 16; i++){        if (h->long_ref[i] != NULL) {            h->long_ref[i] = NULL;        }		if (h->short_ref[i] != NULL) {            h->short_ref[i] = NULL;        }    }	h->long_ref_count = 0;	h->short_ref_count = 0;    if( h->sps )    {        for( i = 0; i < h->dpb.used_size; i++ )        {            h->dpb.fs[i]->i_poc = -1;        }		h->dpb.used_size = 0;        h->fdec = h->dpb.fs[0];        h->i_ref0 = 0;        h->i_ref1 = 0;    }}/* The slice reading is split in two part: *      - before ref_pic_list_reordering( ) *      - after  dec_ref_pic_marking( ) */static int x264_slice_header_part1_read( bs_t *s,                                         x264_slice_header_t *sh, x264_sps_t sps_array[32], x264_pps_t pps_array[256], int b_idr ){    sh->i_first_mb = bs_read_ue( s );    sh->i_type = bs_read_ue( s );    if( sh->i_type >= 5 )    {        sh->i_type -= 5;    }    sh->i_pps_id = bs_read_ue( s );    if( bs_eof( s ) || sh->i_pps_id >= 256 || pps_array[sh->i_pps_id].i_id == -1 )    {        fprintf( stderr, "invalid pps_id in slice header\n" );        return -1;    }    sh->pps = &pps_array[sh->i_pps_id];    sh->sps = &sps_array[sh->pps->i_sps_id];    /* valid if pps valid */    sh->i_frame_num = bs_read( s, sh->sps->i_log2_max_frame_num );    if( !sh->sps->b_frame_mbs_only )    {        sh->b_field_pic = bs_read1( s );        if( sh->b_field_pic )        {            sh->b_bottom_field = bs_read1( s );        }    }    if( b_idr )    {        sh->i_idr_pic_id = bs_read_ue( s );    }    else    {        sh->i_idr_pic_id = 0;    }    if( sh->sps->i_poc_type == 0 )    {        sh->i_poc_lsb = bs_read( s, sh->sps->i_log2_max_poc_lsb );        if( sh->pps->b_pic_order && !sh->b_field_pic )        {            sh->i_delta_poc_bottom = bs_read_se( s );        }    }    else if( sh->sps->i_poc_type == 1 && !sh->sps->b_delta_pic_order_always_zero )    {        sh->i_delta_poc[0] = bs_read_se( s );        if( sh->pps->b_pic_order && !sh->b_field_pic )        {            sh->i_delta_poc[1] = bs_read_se( s );        }    }    if( sh->pps->b_redundant_pic_cnt )    {        sh->i_redundant_pic_cnt = bs_read_ue( s );    }    if( sh->i_type == SLICE_TYPE_B )    {        sh->b_direct_spatial_mv_pred = bs_read1( s );    }    if( sh->i_type == SLICE_TYPE_P || sh->i_type == SLICE_TYPE_SP || sh->i_type == SLICE_TYPE_B )    {        sh->b_num_ref_idx_override = bs_read1( s );        sh->i_num_ref_idx_l0_active = sh->pps->i_num_ref_idx_l0_active; /* default */        sh->i_num_ref_idx_l1_active = sh->pps->i_num_ref_idx_l1_active; /* default */        if( sh->b_num_ref_idx_override )        {            sh->i_num_ref_idx_l0_active = bs_read_ue( s ) + 1;            if( sh->i_type == SLICE_TYPE_B )            {                sh->i_num_ref_idx_l1_active = bs_read_ue( s ) + 1;            }        }    }    return bs_eof( s ) ? -1 : 0;}static int x264_slice_header_part2_read( bs_t *s, x264_slice_header_t *sh ){    if( sh->pps->b_cabac && sh->i_type != SLICE_TYPE_I && sh->i_type != SLICE_TYPE_SI )    {        sh->i_cabac_init_idc = bs_read_ue( s );    }    sh->i_qp_delta = bs_read_se( s );    if( sh->i_type == SLICE_TYPE_SI || sh->i_type == SLICE_TYPE_SP )    {        if( sh->i_type == SLICE_TYPE_SP )        {            sh->b_sp_for_swidth = bs_read1( s );        }        sh->i_qs_delta = bs_read_se( s );    }    if( sh->pps->b_deblocking_filter_control )    {        sh->i_disable_deblocking_filter_idc = bs_read_ue( s );        if( sh->i_disable_deblocking_filter_idc != 1 )        {            sh->i_alpha_c0_offset = bs_read_se( s );            sh->i_beta_offset = bs_read_se( s );        }    }    else    {        sh->i_alpha_c0_offset = 0;        sh->i_beta_offset = 0;    }    if( sh->pps->i_num_slice_groups > 1 && sh->pps->i_slice_group_map_type >= 3 && sh->pps->i_slice_group_map_type <= 5 )    {        /* FIXME */        return -1;    }    return 0;}static int x264_slice_header_ref_pic_reordering( x264_t *h, bs_t *s ){    int ref_pic_list_reordering_flag_10;int ref_pic_list_reordering_flag_11;uint8_t reordering_of_pic_nums_idc;uint8_t abs_diff_pic_num;uint8_t long_term_pic_num;int maxPicNum, currPicNum, picNumLXNoWrap, picNumLXPred, picNumLX;int refIdxLX = 0;int i;x264_frame_t *picLx;int cIdx;int nIdx; h->i_max_frame_num =  2 * h->sps->i_log2_max_frame_num; maxPicNum = h->i_max_frame_num; currPicNum = h->i_frame_num; picNumLXPred = currPicNum; 	/* Now parse the stream and change the default order */    if( h->sh.i_type != SLICE_TYPE_I && h->sh.i_type != SLICE_TYPE_SI )    {        ref_pic_list_reordering_flag_10 = bs_read1( s );        if( ref_pic_list_reordering_flag_10 )				do{				reordering_of_pic_nums_idc = bs_read_ue(s);				if(reordering_of_pic_nums_idc == 0 || 					reordering_of_pic_nums_idc == 1)					{					abs_diff_pic_num = bs_read_ue(s) + 1 ;					}				else if ( reordering_of_pic_nums_idc == 2)					{					long_term_pic_num = bs_read_ue(s);					}				} while( reordering_of_pic_nums_idc != 3);        						if (reordering_of_pic_nums_idc < 2)				{				if (reordering_of_pic_nums_idc == 0)					{					if( picNumLXPred - ( abs_diff_pic_num ) < 0 )						picNumLXNoWrap = picNumLXPred - abs_diff_pic_num + maxPicNum;					else						picNumLXNoWrap = picNumLXPred - abs_diff_pic_num;					}				else // (remapping_of_pic_nums_idc[i] == 1)				{				if( picNumLXPred + abs_diff_pic_num  >=  maxPicNum )					picNumLXNoWrap = picNumLXPred + abs_diff_pic_num - maxPicNum;				else					picNumLXNoWrap = picNumLXPred + abs_diff_pic_num;				}				picNumLXPred = picNumLXNoWrap;								if( picNumLXNoWrap > currPicNum )					picNumLX = picNumLXNoWrap - maxPicNum;				else					picNumLX = picNumLXNoWrap;				for ( i=0; i < h->dpb.used_size; i++)					{					if(( !h->dpb.fs[i]->is_long_ref )&&( h->dpb.fs[i]->i_frame_num == picNumLX))						{						picLx = h->dpb.fs[i];						break;						}					}				for( cIdx = h->sh.i_num_ref_idx_l0_active; cIdx > refIdxLX; cIdx-- )					h->fref0[cIdx] = h->fref0[cIdx-1];								h->fref0[ (refIdxLX)++ ] = picLx;				nIdx = refIdxLX;				for( cIdx = refIdxLX; cIdx <= h->sh.i_num_ref_idx_l0_active; cIdx++ )					if (h->fref0[ cIdx ])						if( (h->fref0[ cIdx ]->is_long_ref ) ||  (h->fref0[ cIdx ]->i_frame_num != picNumLX ))							h->fref0[ nIdx++ ] = h->fref0[ cIdx ];										}						if (reordering_of_pic_nums_idc == 2)				{				for ( i=0; i < h->dpb.used_size; i++)					{					if(( h->dpb.fs[i]->is_long_ref )&&( h->dpb.fs[i]->longtermpicnum == long_term_pic_num))						{						picLx = h->dpb.fs[i];						break;						}					}					for( cIdx = h->sh.i_num_ref_idx_l0_active; cIdx > refIdxLX; cIdx-- )						h->fref0[cIdx] = h->fref0[cIdx-1];					h->fref0[ (refIdxLX)++ ] = picLx;					nIdx = refIdxLX;					for( cIdx = refIdxLX; cIdx <= h->sh.i_num_ref_idx_l0_active; cIdx++ )						if (h->fref0[ cIdx ])							if( (!h->fref0[ cIdx ]->is_long_ref ) ||  (h->fref0[ cIdx ]->longtermpicnum != long_term_pic_num ))								h->fref0[ nIdx++ ] = h->fref0[ cIdx ];									}    	}	    if( h->sh.i_type == SLICE_TYPE_B )    {        ref_pic_list_reordering_flag_11 = bs_read1( s );	  refIdxLX = 0;	          if( ref_pic_list_reordering_flag_11 )			do{				reordering_of_pic_nums_idc = bs_read_ue(s);				if(reordering_of_pic_nums_idc == 0 || 					reordering_of_pic_nums_idc == 1)					{					abs_diff_pic_num = bs_read_ue(s) + 1 ;					}				else if ( reordering_of_pic_nums_idc == 2)					{					long_term_pic_num = bs_read_ue(s);					}				} while( reordering_of_pic_nums_idc != 3);    						if (reordering_of_pic_nums_idc < 2)				{				if (reordering_of_pic_nums_idc == 0)					{					if( picNumLXPred - ( abs_diff_pic_num ) < 0 )						picNumLXNoWrap = picNumLXPred - abs_diff_pic_num + maxPicNum;					else						picNumLXNoWrap = picNumLXPred - abs_diff_pic_num;					}				else // (remapping_of_pic_nums_idc[i] == 1)				{				if( picNumLXPred + abs_diff_pic_num  >=  maxPicNum )					picNumLXNoWrap = picNumLXPred + abs_diff_pic_num - maxPicNum;				else					picNumLXNoWrap = picNumLXPred + abs_diff_pic_num;				}				picNumLXPred = picNumLXNoWrap;				if( picNumLXNoWrap > currPicNum )					picNumLX = picNumLXNoWrap - maxPicNum;				else					picNumLX = picNumLXNoWrap;				for ( i=0; i < h->dpb.used_size; i++)					{					if(( !h->dpb.fs[i]->is_long_ref )&&( h->dpb.fs[i]->i_frame_num == picNumLX))						{						picLx = h->dpb.fs[i];						break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区免费在线| 国产日产欧美一区二区视频| 一区二区三区久久| 日本韩国精品一区二区在线观看| 一区在线观看免费| 欧亚一区二区三区| 秋霞成人午夜伦在线观看| 日韩欧美三级在线| 国产99久久久国产精品潘金 | 日韩你懂的在线播放| 精品一区二区在线免费观看| www精品美女久久久tv| 成人毛片在线观看| 一区二区三区免费网站| 91精品国产一区二区三区蜜臀| 看电视剧不卡顿的网站| 国产精品色噜噜| 欧美综合色免费| 秋霞av亚洲一区二区三| 国产日产精品1区| 91行情网站电视在线观看高清版| 成人性视频免费网站| 亚洲欧美激情视频在线观看一区二区三区| 色综合久久天天| 毛片基地黄久久久久久天堂| 国产亚洲精品中文字幕| 色视频成人在线观看免| 韩国av一区二区三区四区 | 欧美肥妇bbw| 国产尤物一区二区在线| 亚洲乱码日产精品bd| 日韩精品一区在线| 在线视频中文字幕一区二区| 精品一区二区三区蜜桃| 亚洲综合丁香婷婷六月香| 日韩一区二区精品| 一本一道综合狠狠老| 久久精品国产精品亚洲精品| 中文字幕亚洲欧美在线不卡| 日韩午夜电影av| 色综合久久久久综合体| 狠狠色丁香久久婷婷综合_中 | 亚洲成人高清在线| 欧美成人r级一区二区三区| 99国产精品国产精品久久| 麻豆精品视频在线观看| 亚洲猫色日本管| 国产视频一区在线观看 | 成人午夜电影久久影院| 免费在线观看日韩欧美| 一区二区三区免费网站| 国产精品美日韩| 日韩欧美中文字幕精品| 91成人在线观看喷潮| 粉嫩蜜臀av国产精品网站| 麻豆一区二区三区| 亚洲成人精品在线观看| 亚洲九九爱视频| 中文字幕av一区二区三区| 日韩美一区二区三区| 欧美精品一二三四| 日本高清不卡一区| 91亚洲精品久久久蜜桃| 国产999精品久久久久久绿帽| 久久成人免费网站| 日本不卡的三区四区五区| 亚洲午夜在线视频| 一区二区三区在线免费播放| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 国产午夜亚洲精品理论片色戒 | 日韩精品一区二区三区在线观看| 欧美日韩小视频| 欧美吞精做爰啪啪高潮| 色8久久人人97超碰香蕉987| av电影一区二区| 成人av免费观看| 波多野结衣亚洲| caoporn国产一区二区| 波多野结衣在线一区| 不卡的av中国片| 91亚洲永久精品| 在线一区二区三区| 欧美性大战久久久久久久| 精品视频全国免费看| 欧美日韩国产影片| 欧美一区二区三区免费视频 | 亚洲一区二区五区| 亚洲福中文字幕伊人影院| 亚洲成人福利片| 免费在线观看视频一区| 麻豆精品国产91久久久久久| 精品一区二区三区久久| 在线免费不卡电影| 欧美精品v国产精品v日韩精品| 欧美久久婷婷综合色| 欧美另类高清zo欧美| 日韩欧美在线网站| 国产亚洲女人久久久久毛片| 国产精品久久久久久久裸模 | 国产日本欧洲亚洲| 18成人在线观看| 偷拍亚洲欧洲综合| 国产一区久久久| 99久久99久久精品免费看蜜桃| 在线亚洲一区二区| 日韩欧美中文字幕制服| 国产精品日韩精品欧美在线| 亚洲欧美区自拍先锋| 人人狠狠综合久久亚洲| 国产精品一品二品| 在线视频你懂得一区| 欧美tickling网站挠脚心| 亚洲国产精品ⅴa在线观看| 亚洲已满18点击进入久久| 久久成人免费网| 色婷婷av一区二区三区软件| 日韩欧美二区三区| 17c精品麻豆一区二区免费| 日韩经典一区二区| 不卡欧美aaaaa| 日韩午夜精品电影| 亚洲欧美另类在线| 久久99精品久久久久久动态图| 99久免费精品视频在线观看| 欧美一区二区在线观看| 精品亚洲国内自在自线福利| 成人免费av网站| 在线播放一区二区三区| 国产精品成人免费精品自在线观看| 亚洲国产一区视频| 成人污污视频在线观看| 日韩欧美国产不卡| 亚洲国产精品久久人人爱蜜臀 | 国产肉丝袜一区二区| 亚洲国产一区二区三区青草影视| 国产高清久久久| 91精品国产综合久久香蕉的特点 | 色婷婷国产精品久久包臀| 精品福利av导航| 亚洲成人免费视频| 99久久综合狠狠综合久久| 久久综合九色综合久久久精品综合| 亚洲一区二区三区四区五区黄| 成人毛片老司机大片| 日韩一区二区三| 亚洲成人你懂的| 在线观看91精品国产入口| 国产欧美视频在线观看| 精品一区二区影视| 777奇米成人网| 亚洲成国产人片在线观看| 色一区在线观看| 最新不卡av在线| 福利一区二区在线| 久久综合一区二区| 久久99精品一区二区三区三区| 56国语精品自产拍在线观看| 亚洲国产精品久久久久婷婷884| 91一区二区在线观看| 国产精品白丝在线| 成人av动漫在线| 国产精品家庭影院| 不卡的av网站| 狠狠色狠狠色综合系列| 欧美一级黄色大片| 日日摸夜夜添夜夜添精品视频| 在线视频中文字幕一区二区| 亚洲欧美日韩电影| 91丨九色丨蝌蚪丨老版| 自拍视频在线观看一区二区| 99精品久久只有精品| 亚洲天堂免费看| 色88888久久久久久影院按摩| 亚洲激情图片qvod| 欧美在线观看一区| 亚洲国产色一区| 欧美人狂配大交3d怪物一区| 日韩电影在线免费| 欧美电视剧在线观看完整版| 久久99国产精品免费网站| 久久九九久久九九| av电影在线观看一区| 亚洲精品一卡二卡| 欧美日韩精品一区二区| 麻豆国产91在线播放| 久久久久成人黄色影片| 成人av免费在线| 亚洲一区二区三区影院| 91麻豆精品国产自产在线| 免费成人av资源网| 国产三级三级三级精品8ⅰ区| 成人不卡免费av| 亚洲精品videosex极品| 欧美日韩日日夜夜| 精品一区二区三区免费毛片爱| 国产欧美一区二区精品性| 99久久99久久久精品齐齐| 午夜视频在线观看一区二区| 欧美精品一区二区蜜臀亚洲| 99久久精品国产一区二区三区|