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

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

?? headphone.c

?? VLC Player Source Code
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************************** * headphone.c : headphone virtual spatialization channel mixer module *               -> gives the feeling of a real room with a simple headphone ***************************************************************************** * Copyright (C) 2002-2006 the VideoLAN team * $Id$ * * Authors: Boris Dorès <babal@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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************//***************************************************************************** * Preamble *****************************************************************************/#ifdef HAVE_CONFIG_H# include "config.h"#endif#include <math.h>                                        /* sqrt */#include <vlc_common.h>#include <vlc_plugin.h>#include <vlc_aout.h>#include <vlc_filter.h>#include <vlc_block.h>/***************************************************************************** * Local prototypes *****************************************************************************/static int  Create    ( vlc_object_t * );static void Destroy   ( vlc_object_t * );static void DoWork    ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,                        aout_buffer_t * );/* Audio filter2 */static int  OpenFilter ( vlc_object_t * );static void CloseFilter( vlc_object_t * );static block_t *Convert( filter_t *, block_t * );/***************************************************************************** * Module descriptor *****************************************************************************/#define MODULE_DESCRIPTION N_ ( \     "This effect gives you the feeling that you are standing in a room " \     "with a complete 7.1 speaker set when using only a headphone, " \     "providing a more realistic sound experience. It should also be " \     "more comfortable and less tiring when listening to music for " \     "long periods of time.\nIt works with any source format from mono " \     "to 7.1.")#define HEADPHONE_DIM_TEXT N_("Characteristic dimension")#define HEADPHONE_DIM_LONGTEXT N_( \     "Distance between front left speaker and listener in meters.")#define HEADPHONE_COMPENSATE_TEXT N_("Compensate delay")#define HEADPHONE_COMPENSATE_LONGTEXT N_( \     "The delay which is introduced by the physical algorithm may "\     "sometimes be disturbing for the synchronization between lips-movement "\     "and speech. In case, turn this on to compensate.")#define HEADPHONE_DOLBY_TEXT N_("No decoding of Dolby Surround")#define HEADPHONE_DOLBY_LONGTEXT N_( \     "Dolby Surround encoded streams won't be decoded before being " \     "processed by this filter. Enabling this setting is not recommended.")vlc_module_begin();    set_description( N_("Headphone virtual spatialization effect") );    set_shortname( N_("Headphone effect") );    set_help( MODULE_DESCRIPTION );    set_category( CAT_AUDIO );    set_subcategory( SUBCAT_AUDIO_AFILTER );    add_integer( "headphone-dim", 10, NULL, HEADPHONE_DIM_TEXT,                 HEADPHONE_DIM_LONGTEXT, false );    add_bool( "headphone-compensate", 0, NULL, HEADPHONE_COMPENSATE_TEXT,              HEADPHONE_COMPENSATE_LONGTEXT, true );    add_bool( "headphone-dolby", 0, NULL, HEADPHONE_DOLBY_TEXT,              HEADPHONE_DOLBY_LONGTEXT, true );    set_capability( "audio filter", 0 );    set_callbacks( Create, Destroy );    add_shortcut( "headphone" );    /* Audio filter 2 */    add_submodule();    set_description( N_("Headphone virtual spatialization effect") );    set_capability( "audio filter2", 0 );    set_callbacks( OpenFilter, CloseFilter );vlc_module_end();/***************************************************************************** * Internal data structures *****************************************************************************/struct atomic_operation_t{    int i_source_channel_offset;    int i_dest_channel_offset;    unsigned int i_delay;/* in sample unit */    double d_amplitude_factor;};struct aout_filter_sys_t{    size_t i_overflow_buffer_size;/* in bytes */    uint8_t * p_overflow_buffer;    unsigned int i_nb_atomic_operations;    struct atomic_operation_t * p_atomic_operations;};struct filter_sys_t{    size_t i_overflow_buffer_size;/* in bytes */    uint8_t * p_overflow_buffer;    unsigned int i_nb_atomic_operations;    struct atomic_operation_t * p_atomic_operations;};/***************************************************************************** * Init: initialize internal data structures * and computes the needed atomic operations *****************************************************************************//* x and z represent the coordinates of the virtual speaker *  relatively to the center of the listener's head, measured in meters : * *  left              right *Z *- *a          head *x *i *s *  rear left    rear right * *          x-axis *  */static void ComputeChannelOperations( struct aout_filter_sys_t * p_data        , unsigned int i_rate, unsigned int i_next_atomic_operation        , int i_source_channel_offset, double d_x, double d_z        , double d_compensation_length, double d_channel_amplitude_factor ){    double d_c = 340; /*sound celerity (unit: m/s)*/    double d_compensation_delay = (d_compensation_length-0.1) / d_c * i_rate;    /* Left ear */    p_data->p_atomic_operations[i_next_atomic_operation]        .i_source_channel_offset = i_source_channel_offset;    p_data->p_atomic_operations[i_next_atomic_operation]        .i_dest_channel_offset = 0;/* left */    p_data->p_atomic_operations[i_next_atomic_operation]        .i_delay = (int)( sqrt( (-0.1-d_x)*(-0.1-d_x) + (0-d_z)*(0-d_z) )                          / d_c * i_rate - d_compensation_delay );    if( d_x < 0 )    {        p_data->p_atomic_operations[i_next_atomic_operation]            .d_amplitude_factor = d_channel_amplitude_factor * 1.1 / 2;    }    else if( d_x > 0 )    {        p_data->p_atomic_operations[i_next_atomic_operation]            .d_amplitude_factor = d_channel_amplitude_factor * 0.9 / 2;    }    else    {        p_data->p_atomic_operations[i_next_atomic_operation]            .d_amplitude_factor = d_channel_amplitude_factor / 2;    }    /* Right ear */    p_data->p_atomic_operations[i_next_atomic_operation + 1]        .i_source_channel_offset = i_source_channel_offset;    p_data->p_atomic_operations[i_next_atomic_operation + 1]        .i_dest_channel_offset = 1;/* right */    p_data->p_atomic_operations[i_next_atomic_operation + 1]        .i_delay = (int)( sqrt( (0.1-d_x)*(0.1-d_x) + (0-d_z)*(0-d_z) )                          / d_c * i_rate - d_compensation_delay );    if( d_x < 0 )    {        p_data->p_atomic_operations[i_next_atomic_operation + 1]            .d_amplitude_factor = d_channel_amplitude_factor * 0.9 / 2;    }    else if( d_x > 0 )    {        p_data->p_atomic_operations[i_next_atomic_operation + 1]            .d_amplitude_factor = d_channel_amplitude_factor * 1.1 / 2;    }    else    {        p_data->p_atomic_operations[i_next_atomic_operation + 1]            .d_amplitude_factor = d_channel_amplitude_factor / 2;    }}static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data        , unsigned int i_nb_channels, uint32_t i_physical_channels        , unsigned int i_rate ){    double d_x = config_GetInt( p_this, "headphone-dim" );    double d_z = d_x;    double d_z_rear = -d_x/3;    double d_min = 0;    unsigned int i_next_atomic_operation;    int i_source_channel_offset;    unsigned int i;    if( config_GetInt( p_this, "headphone-compensate" ) )    {        /* minimal distance to any speaker */        if( i_physical_channels & AOUT_CHAN_REARCENTER )        {            d_min = d_z_rear;        }        else        {            d_min = d_z;        }    }    /* Number of elementary operations */    p_data->i_nb_atomic_operations = i_nb_channels * 2;    if( i_physical_channels & AOUT_CHAN_CENTER )    {        p_data->i_nb_atomic_operations += 2;    }    p_data->p_atomic_operations = malloc( sizeof(struct atomic_operation_t)            * p_data->i_nb_atomic_operations );    if( p_data->p_atomic_operations == NULL )        return -1;    /* For each virtual speaker, computes elementary wave propagation time     * to each ear */    i_next_atomic_operation = 0;    i_source_channel_offset = 0;    if( i_physical_channels & AOUT_CHAN_LEFT )    {        ComputeChannelOperations( p_data , i_rate                , i_next_atomic_operation , i_source_channel_offset                , -d_x , d_z , d_min , 2.0 / i_nb_channels );        i_next_atomic_operation += 2;        i_source_channel_offset++;    }    if( i_physical_channels & AOUT_CHAN_RIGHT )    {        ComputeChannelOperations( p_data , i_rate                , i_next_atomic_operation , i_source_channel_offset                , d_x , d_z , d_min , 2.0 / i_nb_channels );        i_next_atomic_operation += 2;        i_source_channel_offset++;    }    if( i_physical_channels & AOUT_CHAN_MIDDLELEFT )    {        ComputeChannelOperations( p_data , i_rate                , i_next_atomic_operation , i_source_channel_offset                , -d_x , 0 , d_min , 1.5 / i_nb_channels );        i_next_atomic_operation += 2;        i_source_channel_offset++;    }    if( i_physical_channels & AOUT_CHAN_MIDDLERIGHT )    {        ComputeChannelOperations( p_data , i_rate                , i_next_atomic_operation , i_source_channel_offset                , d_x , 0 , d_min , 1.5 / i_nb_channels );        i_next_atomic_operation += 2;        i_source_channel_offset++;    }    if( i_physical_channels & AOUT_CHAN_REARLEFT )    {        ComputeChannelOperations( p_data , i_rate                , i_next_atomic_operation , i_source_channel_offset                , -d_x , d_z_rear , d_min , 1.5 / i_nb_channels );        i_next_atomic_operation += 2;        i_source_channel_offset++;    }    if( i_physical_channels & AOUT_CHAN_REARRIGHT )    {        ComputeChannelOperations( p_data , i_rate                , i_next_atomic_operation , i_source_channel_offset                , d_x , d_z_rear , d_min , 1.5 / i_nb_channels );        i_next_atomic_operation += 2;        i_source_channel_offset++;    }    if( i_physical_channels & AOUT_CHAN_REARCENTER )    {        ComputeChannelOperations( p_data , i_rate                , i_next_atomic_operation , i_source_channel_offset                , 0 , -d_z , d_min , 1.5 / i_nb_channels );        i_next_atomic_operation += 2;        i_source_channel_offset++;    }    if( i_physical_channels & AOUT_CHAN_CENTER )    {        /* having two center channels increases the spatialization effect */        ComputeChannelOperations( p_data , i_rate                , i_next_atomic_operation , i_source_channel_offset                , d_x / 5.0 , d_z , d_min , 0.75 / i_nb_channels );        i_next_atomic_operation += 2;        ComputeChannelOperations( p_data , i_rate                , i_next_atomic_operation , i_source_channel_offset                , -d_x / 5.0 , d_z , d_min , 0.75 / i_nb_channels );        i_next_atomic_operation += 2;        i_source_channel_offset++;    }    if( i_physical_channels & AOUT_CHAN_LFE )    {        ComputeChannelOperations( p_data , i_rate                , i_next_atomic_operation , i_source_channel_offset                , 0 , d_z_rear , d_min , 5.0 / i_nb_channels );        i_next_atomic_operation += 2;        i_source_channel_offset++;    }    /* Initialize the overflow buffer     * we need it because the process induce a delay in the samples */    p_data->i_overflow_buffer_size = 0;    for( i = 0 ; i < p_data->i_nb_atomic_operations ; i++ )    {        if( p_data->i_overflow_buffer_size                < p_data->p_atomic_operations[i].i_delay * 2 * sizeof (float) )        {            p_data->i_overflow_buffer_size                = p_data->p_atomic_operations[i].i_delay * 2 * sizeof (float);        }    }    p_data->p_overflow_buffer = malloc( p_data->i_overflow_buffer_size );    if( p_data->p_overflow_buffer == NULL )    {        free( p_data->p_atomic_operations );        return -1;    }    memset( p_data->p_overflow_buffer, 0 , p_data->i_overflow_buffer_size );    return 0;}/***************************************************************************** * Create: allocate headphone downmixer *****************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜理伦三级在线观看| 日本免费新一区视频| 欧美剧在线免费观看网站| 国产成人亚洲综合a∨婷婷图片| 一区二区三区高清在线| 欧美韩日一区二区三区四区| 91激情在线视频| 国产成人一区在线| 极品瑜伽女神91| 中文字幕欧美一| 久久影院电视剧免费观看| 日本电影亚洲天堂一区| 国产乱码精品一区二区三 | 成人污视频在线观看| 午夜影院在线观看欧美| 久久青草欧美一区二区三区| 欧美精品成人一区二区三区四区| 成人av在线一区二区| 九九视频精品免费| 另类小说图片综合网| 久久国产精品99久久人人澡| 亚洲成在线观看| 亚洲午夜精品17c| 亚洲国产精品自拍| 天天综合天天综合色| 亚洲一二三区视频在线观看| 国产精品精品国产色婷婷| 国产精品热久久久久夜色精品三区| 国产精品美女久久久久av爽李琼| 国产精品电影院| 亚洲成在线观看| 精品一区二区影视| 成人激情免费视频| 欧美日韩国产123区| 久久久久久影视| 亚洲毛片av在线| 国产麻豆91精品| 91影院在线观看| 久久久天堂av| 一区二区三区 在线观看视频| 免费视频一区二区| 色婷婷av一区二区三区大白胸| 51精品秘密在线观看| 国产农村妇女精品| 午夜精品一区在线观看| 粉嫩aⅴ一区二区三区四区| 欧美理论片在线| 日韩一区欧美一区| 国产一区二区毛片| 日韩视频一区二区| 亚洲一级电影视频| 91亚洲精华国产精华精华液| 精品国产乱码久久久久久蜜臀| 亚洲精品中文在线| 91香蕉视频在线| 亚洲国产精品ⅴa在线观看| 日本不卡一区二区三区高清视频| 99久久精品免费看| 国产精品久久看| 成人激情图片网| 国产日韩av一区二区| 久久超碰97人人做人人爱| 91精品国产综合久久久久久久久久 | 国产原创一区二区三区| 欧美一区二区日韩一区二区| 亚洲va欧美va人人爽午夜| 91麻豆成人久久精品二区三区| 极品少妇xxxx偷拍精品少妇| 欧美一区欧美二区| 久久99精品久久久久久动态图| 日韩一区二区免费在线观看| 日韩精品欧美成人高清一区二区| 欧美日韩亚洲综合一区二区三区| 一区二区三区在线播放| 欧美三级视频在线观看| 日韩电影一区二区三区四区| 日韩一区二区三区免费观看| 久久狠狠亚洲综合| 国产欧美日韩麻豆91| 91丨九色丨黑人外教| 亚洲一区二区五区| 日韩免费看的电影| 成人网男人的天堂| 亚洲精品视频在线观看网站| 欧美三级日本三级少妇99| 日韩黄色在线观看| 久久亚洲一区二区三区四区| 91浏览器入口在线观看| 免费在线看成人av| 国产视频亚洲色图| 亚洲美女视频在线观看| 久久婷婷国产综合国色天香| 色综合久久天天综合网| 伦理电影国产精品| 亚洲欧洲中文日韩久久av乱码| 欧美综合欧美视频| 波多野结衣在线aⅴ中文字幕不卡| 亚洲福利电影网| 国产精品乱码一区二三区小蝌蚪| 欧美男女性生活在线直播观看| 国产露脸91国语对白| 亚洲成人黄色影院| 成人欧美一区二区三区在线播放| 精品少妇一区二区三区在线视频| 欧美日韩亚洲高清一区二区| 成人免费精品视频| 懂色中文一区二区在线播放| 激情综合一区二区三区| 亚洲综合激情另类小说区| 中文字幕亚洲一区二区av在线 | 日本一区二区三级电影在线观看| 欧美色综合久久| 91久久国产综合久久| 99精品久久免费看蜜臀剧情介绍| 久久99精品久久久久婷婷| 日本一道高清亚洲日美韩| 午夜av电影一区| 婷婷一区二区三区| 亚洲成人av中文| 亚洲成人精品影院| 亚洲成人一区在线| 日韩二区三区四区| 视频在线观看一区| 美女被吸乳得到大胸91| 麻豆精品久久久| 懂色av噜噜一区二区三区av| 成人av电影免费在线播放| 日本高清免费不卡视频| 欧美日韩高清影院| 欧美xxxxxxxxx| 国产精品美女久久久久aⅴ | 中文字幕的久久| 一区二区高清在线| 精品一区二区三区在线视频| 成人免费高清视频| 欧美日韩在线播| 久久久久国产精品人| 亚洲精品视频观看| 精品一区二区在线观看| 91在线精品一区二区| 日韩一二在线观看| 1区2区3区精品视频| 美女视频免费一区| 色香色香欲天天天影视综合网| 日韩欧美国产综合| 一区二区三区免费在线观看| 久久精品国产99| 在线视频一区二区三| 日韩美女一区二区三区| 综合中文字幕亚洲| 国内外成人在线| 欧美视频在线观看一区二区| 久久久美女毛片 | 亚洲国产成人av网| 成人av网址在线观看| 欧美一区二区日韩| 亚洲观看高清完整版在线观看| 国产毛片一区二区| 欧美成人一区二区三区片免费 | 激情六月婷婷久久| 欧美高清性hdvideosex| 亚洲激情在线激情| 色综合天天综合狠狠| 亚洲欧美激情视频在线观看一区二区三区 | 1024亚洲合集| 欧美日韩午夜精品| 国产精品主播直播| 亚洲色图.com| 91视频观看视频| 一区av在线播放| 欧美日韩国产a| 精品一区二区三区视频| 精品日韩在线一区| 国产成人av网站| 中文字幕中文在线不卡住| 一本一道久久a久久精品综合蜜臀| 亚洲男帅同性gay1069| 欧美在线一二三四区| 青青草原综合久久大伊人精品 | 欧美成人伊人久久综合网| av电影在线观看一区| 日韩在线观看一区二区| 国产欧美一区视频| 3d成人h动漫网站入口| 经典三级一区二区| 洋洋av久久久久久久一区| 日韩一级精品视频在线观看| 成人短视频下载| 日韩成人免费看| 一区二区三区欧美日| 精品国产一区二区三区av性色| 色爱区综合激月婷婷| 国产成人免费在线视频| 日本怡春院一区二区| 亚洲三级在线看| 日韩理论片网站| 日韩一区二区视频| 日韩影院精彩在线| 91麻豆精品国产91久久久更新时间| 99免费精品视频|