Mix and Build(简单DP)

最长字符串链问题解析
本文介绍了一种寻找最长字符串链的问题解决方法,通过DP算法实现。该问题要求找到一系列单词,使得每个单词都是前一个单词的混合扩展。文章提供了一个完整的C++实现代码示例。

Mix and Build
Time Limit: 5000MS Memory Limit: 65536K
Total Submissions: 3936 Accepted: 1203
Case Time Limit: 2000MS Special Judge

Description
In this problem, you are given a list of words (sequence of lower case letters). From this list, find the longest chain of words w1, …, wn such that wi is a mixed extension of wi-1. A word A is a mixed extension of another word B if A can be formed by adding one letter to B and permuting the result. For example, “ab”, “bar”, “crab”, “cobra”, and “carbon” form a chain of length 5.

Input
The input contains at least two, but no more than 10000 lines. Each line contains a word. The length of each word is at least 1 and no more than 20. All words in the input are distinct.

Output
Write the longest chain that can be constructed from the given words. Output each word in the chain on a separate line, starting from the first one. If there are multiple longest chains, any longest chain is acceptable.

Sample Input

ab
arc
arco
bar
bran
carbon
carbons
cobra
crab
crayon
narc

Sample Output

ab
bar
crab
cobra
carbon
carbons

Source
Rocky Mountain 2004
简单的Dp,找最长字符串链,使后一个比前一个的长度大一,并且只有一个字符不同

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#include <map>
#include <algorithm>
#define INF 0x3f3f3f3f
using namespace std;

typedef unsigned long long LL;

const int MAX = 1e5+10;

struct node
{
    char str[25];
    int Hash[26];
    int len;
    int Dp;
    int pre;
    void init()//初始化
    {
        memset(Hash,0,sizeof(Hash));
        len=0;
        Dp=1;
        pre=-1;
    }
    void HASH()//哈希字符
    {
        len=strlen(str);
        for(int i=0;i<len;i++)
        {
            Hash[str[i]-'a']++;
        }
    }
    void Output()
    {
        printf("%s\n",str);
    }
}Ch[11000];

bool cmp(node a,node b)//按照长度进行排序
{
    return a.len<b.len;
}

void DFS(int s)//输出
{
    if(s==-1)
    {
        return ;
    }
    DFS(Ch[s].pre);
    Ch[s].Output();
}

int main()
{
   // freopen("input.txt","r",stdin);
    for(int i=0;i<10001;i++)
    {
        Ch[i].init();
    }
    int top=0;
    while(~scanf("%s",Ch[top].str))
    {
        Ch[top].HASH();
        top++;
    }
    sort(Ch,Ch+top,cmp);
    for(int i=0;i<top;i++)
    {
        for(int j=i-1;j>=0;j--)
        {
            if(Ch[j].len==Ch[i].len)
            {
                continue;
            }
            if(Ch[j].len==Ch[i].len-1)
            {
                int ans=0;
                for(int k=0;k<26;k++)
                {
                    if(Ch[i].Hash[k]!=Ch[j].Hash[k])
                    {
                        ans++;
                    }
                    if(ans>2)
                    {
                        break;
                    }
                }
                if(ans<2)//如果不同的字符大于两个则不符合
                {
                    if(Ch[i].Dp<Ch[j].Dp+1)
                    {
                        Ch[i].Dp=Ch[j].Dp+1;
                        Ch[i].pre=j;
                    }
                }
            }
            else
            {
                break;
            }
        }
    }
    int Max=0,ans;
    for(int i=0;i<top;i++)
    {
        if(Max<Ch[i].Dp)
        {
            Max=Ch[i].Dp;
            ans=i;
        }
    }
    DFS(ans);
    return 0;
}

转载于:https://www.cnblogs.com/juechen/p/5255960.html

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- Copyright (c) 2016-2020, The Linux Foundation. All rights reserved Not a Contribution. --> <!-- Copyright (C) 2015 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Changes from Qualcomm Innovation Center are provided under the following license: Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> <audioPolicyConfiguration version="7.0" xmlns:xi="http://www.w3.org/2001/XInclude"> <!-- version section contains a “version” tag in the form “major.minor” e.g version=”1.0” --> <!-- Global configuration Decalaration --> <globalConfiguration speaker_drc_enabled="true" call_screen_mode_supported="true"/> <!-- Modules section: There is one section per audio HW module present on the platform. Each module section will contains two mandatory tags for audio HAL “halVersion” and “name”. The module names are the same as in current .conf file: “primary”, “A2DP”, “remote_submix”, “USB” Each module will contain the following sections: “devicePorts”: a list of device descriptors for all input and output devices accessible via this module. This contains both permanently attached devices and removable devices.mixPorts”: listing all output and input streams exposed by the audio HAL “routes”: list of possible connections between input and output devices or between stream and devices. "route": is defined by an attribute: -"type": <mux|mix> means all sources are mutual exclusive (mux) or can be mixed (mix) -"sink": the sink involved in this route -"sources": all the sources than can be connected to the sink via vis route “attachedDevices”: permanently attached devices. The attachedDevices section is a list of devices names. The names correspond to device names defined in <devicePorts> section. “defaultOutputDevice”: device to be used by default when no policy rule applies --> <modules> <!-- Primary Audio HAL is now hosted in audio_module_config_primary --> <!-- A2DP Audio HAL --> <!-- <module name="a2dp" halVersion="2.0"> <mixPorts> <mixPort name="a2dp input" role="sink"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/> </mixPort> </mixPorts> <devicePorts> <devicePort tagName="BT A2DP In" type="AUDIO_DEVICE_IN_BLUETOOTH_A2DP" role="source"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/> </devicePort> </devicePorts> <routes> <route type="mix" sink="a2dp input" sources="BT A2DP In"/> </routes> </module> --> <!-- Usb Audio HAL --> <module name="usb" halVersion="2.0"> <mixPorts> <mixPort name="usb_accessory output" role="source"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </mixPort> </mixPorts> <devicePorts> <devicePort tagName="USB Host Out" type="AUDIO_DEVICE_OUT_USB_ACCESSORY" role="sink"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </devicePort> </devicePorts> <routes> <route type="mix" sink="USB Host Out" sources="usb_accessory output"/> </routes> </module> <!-- #ifdef OPLUS_FEATURE_VIRTUAL_AUDIO --> <!-- ZhangHui@MULTIMEDIA.AUDIOSERVER.BASE, 2021/10/11, Add for virtual audio --> <xi:include href="/odm/etc/virtual_audio_policy_configuration.xml"> <xi:fallback></xi:fallback> </xi:include> <!-- #endif OPLUS_FEATURE_VIRTUAL_AUDIO --> <!-- Remote Submix Audio HAL --> <xi:include href="/vendor/etc/r_submix_audio_policy_configuration.xml"/> <!-- Bluetooth Audio HAL for hearing aid --> <xi:include href="/vendor/etc/bluetooth_qti_hearing_aid_audio_policy_configuration.xml"/> <!-- Stub HAL --> <xi:include href="/vendor/etc/stub_audio_policy_configuration.xml"/> </modules> <!-- End of Modules section --> <!-- Volume section --> <xi:include href="/vendor/etc/audio_policy_volumes.xml"/> <xi:include href="/vendor/etc/default_volume_tables.xml"/> <!-- End of Volume section --> </audioPolicyConfiguration> 以上文件路径:/vendor/etc/audio/sku_sun_qssi/audio_policy_configuration.xml 一加13 Coloros15,安卓版本15,修改该文件,绕过安卓音频SRC实现系统全局自适应采样率(Dynamic sampling rates)、自适应位深(Bit_perfect)(保持音频文件原始位深,16bit文件不升级位深)、禁用升频和重采样,关闭所有音频音效(effect)以及影响音频质量无损输出的一切音频处理,最大程度上抑制并降低音频抖动(jitter)(最大化优化时钟管理和同步)、最大程度降低音频失真和噪声以及电源纹波和噪声,以输出和输入最干净无污染最高质量的HIFI无损原始音频信号直出,并且输出修改过的完整文件(不要片段)
最新发布
08-12
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- Copyright (c) 2016-2017, 2019, 2021 The Linux Foundation. All rights reserved Not a Contribution. --> <!-- Copyright (C) 2015 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <audioPolicyConfiguration version="7.0" xmlns:xi="http://www.w3.org/2001/XInclude"> <!-- version section contains a “version” tag in the form “major.minor” e.g version=”1.0” --> <!-- Global configuration Decalaration --> <globalConfiguration speaker_drc_enabled="true"/> <!-- Modules section: There is one section per audio HW module present on the platform. Each module section will contains two mandatory tags for audio HAL “halVersion” and “name”. The module names are the same as in current .conf file: “primary”, “A2DP”, “remote_submix”, “USB” Each module will contain the following sections: “devicePorts”: a list of device descriptors for all input and output devices accessible via this module. This contains both permanently attached devices and removable devices.mixPorts”: listing all output and input streams exposed by the audio HAL “routes”: list of possible connections between input and output devices or between stream and devices. "route": is defined by an attribute: -"type": <mux|mix> means all sources are mutual exclusive (mux) or can be mixed (mix) -"sink": the sink involved in this route -"sources": all the sources than can be connected to the sink via vis route “attachedDevices”: permanently attached devices. The attachedDevices section is a list of devices names. The names correspond to device names defined in <devicePorts> section. “defaultOutputDevice”: device to be used by default when no policy rule applies --> <modules> <module name="primary" halVersion="2.0"> <attachedDevices> <item>Speaker</item> <item>Speaker Safe</item> <item>Earpiece</item> <item>Telephony Tx</item> <item>Built-In Mic</item> <item>Built-In Back Mic</item> <item>Telephony Rx</item> </attachedDevices> <defaultOutputDevice>Speaker</defaultOutputDevice> <mixPorts> <mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_PRIMARY AUDIO_OUTPUT_FLAG_FAST"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </mixPort> <mixPort name="raw" role="source" flags="AUDIO_OUTPUT_FLAG_RAW AUDIO_OUTPUT_FLAG_FAST"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </mixPort> <mixPort name="hifi_playback" role="source" /> <mixPort name="deep_buffer" role="source" flags="AUDIO_OUTPUT_FLAG_DEEP_BUFFER"> <profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED" samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </mixPort> <mixPort name="compressed_offload" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD AUDIO_OUTPUT_FLAG_NON_BLOCKING AUDIO_OUTPUT_FLAG_GAPLESS_OFFLOAD"> <profile name="" format="AUDIO_FORMAT_MP3" samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/> <profile name="" format="AUDIO_FORMAT_AAC_LC" samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000" channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/> <profile name="" format="AUDIO_FORMAT_AAC_HE_V1" samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000 64000 88200 96000" channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/> <profile name="" format="AUDIO_FORMAT_AAC_HE_V2" samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO AUDIO_CHANNEL_OUT_MONO"/> </mixPort> <mixPort name="voice_tx" role="source"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="8000 16000 48000" channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/> </mixPort> <mixPort name="mmap_no_irq_out" role="source" flags="AUDIO_OUTPUT_FLAG_DIRECT AUDIO_OUTPUT_FLAG_MMAP_NOIRQ"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </mixPort> <mixPort name="voip_rx" role="source" flags="AUDIO_OUTPUT_FLAG_VOIP_RX"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="8000 16000 32000 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </mixPort> <mixPort name="incall_music_uplink" role="source" flags="AUDIO_OUTPUT_FLAG_INCALL_MUSIC"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="8000 16000 48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </mixPort> <mixPort name="primary input" role="sink"> <profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT" samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3"/> </mixPort> <mixPort name="fast input" role="sink" flags="AUDIO_INPUT_FLAG_FAST"> <profile name="" format="AUDIO_FORMAT_PCM_8_24_BIT" samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3"/> </mixPort> <mixPort name="hifi_input" role="sink" /> <mixPort name="voice_rx" role="sink"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="8000 16000 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/> </mixPort> <mixPort name="mmap_no_irq_in" role="sink" flags="AUDIO_INPUT_FLAG_MMAP_NOIRQ"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="8000 11025 12000 16000 22050 24000 32000 44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO AUDIO_CHANNEL_IN_FRONT_BACK AUDIO_CHANNEL_INDEX_MASK_3"/> </mixPort> <mixPort name="voip_tx" role="sink" flags="AUDIO_INPUT_FLAG_VOIP_TX"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="8000 16000 32000 48000" channelMasks="AUDIO_CHANNEL_IN_MONO"/> </mixPort> </mixPorts> <devicePorts> <devicePort tagName="Earpiece" type="AUDIO_DEVICE_OUT_EARPIECE" role="sink"> </devicePort> <devicePort tagName="Speaker" type="AUDIO_DEVICE_OUT_SPEAKER" role="sink"> </devicePort> <devicePort tagName="Speaker Safe" type="AUDIO_DEVICE_OUT_SPEAKER_SAFE" role="sink"> </devicePort> <devicePort tagName="BT SCO" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO" role="sink"> </devicePort> <devicePort tagName="BT SCO Headset" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET" role="sink"> </devicePort> <devicePort tagName="BT SCO Car Kit" type="AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT" role="sink"> </devicePort> <devicePort tagName="Telephony Tx" type="AUDIO_DEVICE_OUT_TELEPHONY_TX" role="sink"> </devicePort> <devicePort tagName="USB Device Out" type="AUDIO_DEVICE_OUT_USB_DEVICE" role="sink"> </devicePort> <devicePort tagName="USB Headset Out" type="AUDIO_DEVICE_OUT_USB_HEADSET" role="sink"> </devicePort> <devicePort tagName="BT A2DP Out" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP" role="sink" encodedFormats="AUDIO_FORMAT_LDAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100 48000 88200 96000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </devicePort> <devicePort tagName="BT A2DP Headphones" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES" role="sink" encodedFormats="AUDIO_FORMAT_LDAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100 48000 88200 96000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </devicePort> <devicePort tagName="BT A2DP Speaker" type="AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER" role="sink" encodedFormats="AUDIO_FORMAT_LDAC AUDIO_FORMAT_APTX AUDIO_FORMAT_APTX_HD AUDIO_FORMAT_AAC AUDIO_FORMAT_SBC"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100 48000 88200 96000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </devicePort> <devicePort tagName="Built-In Mic" type="AUDIO_DEVICE_IN_BUILTIN_MIC" role="source"> </devicePort> <devicePort tagName="Built-In Back Mic" type="AUDIO_DEVICE_IN_BACK_MIC" role="source"> </devicePort> <devicePort tagName="BT SCO Headset Mic" type="AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET" role="source"> </devicePort> <devicePort tagName="Telephony Rx" type="AUDIO_DEVICE_IN_TELEPHONY_RX" role="source"> </devicePort> <!-- TODO: Enable multi-channel recording --> <devicePort tagName="USB Device In" type="AUDIO_DEVICE_IN_USB_DEVICE" role="source"> </devicePort> <devicePort tagName="USB Headset In" type="AUDIO_DEVICE_IN_USB_HEADSET" role="source"> </devicePort> </devicePorts> <routes> <route type="mix" sink="Earpiece" sources="primary output,raw,deep_buffer,mmap_no_irq_out,voip_rx"/> <route type="mix" sink="Speaker" sources="primary output,raw,deep_buffer,compressed_offload,mmap_no_irq_out,voip_rx"/> <route type="mix" sink="Speaker Safe" sources="primary output,raw,deep_buffer,compressed_offload,mmap_no_irq_out,voip_rx"/> <route type="mix" sink="BT SCO" sources="primary output,raw,deep_buffer,voip_rx"/> <route type="mix" sink="BT SCO Headset" sources="primary output,raw,deep_buffer,voip_rx"/> <route type="mix" sink="BT SCO Car Kit" sources="primary output,raw,deep_buffer,voip_rx"/> <route type="mix" sink="USB Device Out" sources="primary output,raw,deep_buffer,compressed_offload,hifi_playback,mmap_no_irq_out,voip_rx"/> <route type="mix" sink="USB Headset Out" sources="primary output,raw,deep_buffer,compressed_offload,hifi_playback,mmap_no_irq_out,voip_rx"/> <route type="mix" sink="Telephony Tx" sources="voice_tx,incall_music_uplink"/> <route type="mix" sink="primary input" sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/> <route type="mix" sink="fast input" sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/> <route type="mix" sink="voice_rx" sources="Telephony Rx"/> <route type="mix" sink="hifi_input" sources="USB Device In,USB Headset In" /> <route type="mix" sink="mmap_no_irq_in" sources="Built-In Mic,Built-In Back Mic,USB Device In,USB Headset In"/> <route type="mix" sink="voip_tx" sources="Built-In Mic,Built-In Back Mic,BT SCO Headset Mic,USB Device In,USB Headset In"/> <route type="mix" sink="BT A2DP Out" sources="primary output,deep_buffer,compressed_offload,voip_rx"/> <route type="mix" sink="BT A2DP Headphones" sources="primary output,deep_buffer,compressed_offload,voip_rx"/> <route type="mix" sink="BT A2DP Speaker" sources="primary output,deep_buffer,compressed_offload,voip_rx"/> </routes> </module> <!-- A2DP Input Audio HAL --> <module name="a2dp" halVersion="2.0"> <mixPorts> <mixPort name="a2dp input" role="sink"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/> </mixPort> </mixPorts> <devicePorts> <devicePort tagName="BT A2DP In" type="AUDIO_DEVICE_IN_BLUETOOTH_A2DP" role="source"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100 48000" channelMasks="AUDIO_CHANNEL_IN_MONO AUDIO_CHANNEL_IN_STEREO"/> </devicePort> </devicePorts> <routes> <route type="mix" sink="a2dp input" sources="BT A2DP In"/> </routes> </module> <!-- Usb Audio HAL --> <module name="usb" halVersion="2.0"> <mixPorts> <mixPort name="usb_accessory output" role="source"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </mixPort> </mixPorts> <devicePorts> <devicePort tagName="USB Host Out" type="AUDIO_DEVICE_OUT_USB_ACCESSORY" role="sink"> <profile name="" format="AUDIO_FORMAT_PCM_16_BIT" samplingRates="44100" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/> </devicePort> </devicePorts> <routes> <route type="mix" sink="USB Host Out" sources="usb_accessory output"/> </routes> </module> <!-- Remote Submix Audio HAL --> <xi:include href="r_submix_audio_policy_configuration.xml"/> </modules> <!-- End of Modules section --> <!-- Volume section --> <xi:include href="audio_policy_volumes.xml"/> <xi:include href="default_volume_tables.xml"/> <!-- End of Volume section --> </audioPolicyConfiguration> 以上文件路径:vendor/etc/audio_policy_configuration.xml 一加13 coloros15,修改该文件,绕过安卓音频src实现系统全局自适应采样率及自适应位深无损音频输出,关闭所有音频音效(effect)以及影响音频质量无损输出的一切音频处理,并且最大程度上抑制降低音频抖动(jitter)、音频失真和噪声、电源噪声,以输出最干净最高质量的无损hifi原始音频直出,输出修改过的完整文件
08-12
#=============================================================================== # @brief cmake product info # Copyright (c) CompanyNameMagicTag 2022-2022. All rights reserved. #=============================================================================== set(CONFIG_CHIP_NAME "tiangong0") set(CONFIG_CHIP_VERSION "asic") set(CONFIG_PRODUCT_NAME "cmcc_hgu") set(CONFIG_PRODUCT_VERSION "HiSmartHub_1.2.T05.linux0") set(CONFIG_LINX_XGE_VER_TYPE debug) set(CONFIG_FLASH_TYPE "nand") set(CONFIG_FLASH_PAGE_SIZE 2048) set(CONFIG_FLASH_BLOCK_SIZE 131072) set(CONFIG_FLASH_PARTS_NAME cmcc_hgu) set(CONFIG_FLASH_LOGIC_BLOCK_SIZE 124KiB) set(CONFIG_BASIC_VOL_SIZE 38MiB) set(CONFIG_BASIC_JOURNAL_SIZE 2MiB) set(CONFIG_OVERLAY_VOL_SIZE 4MiB) set(CONFIG_OVERLAY_JOURNAL_SIZE 1MiB) set(CONFIG_UBOOT_SIZE_MAX 1048576) set(CONFIG_PLAT_KERNEL_ARCH CONFIG_PLAT_KERNEL_ARM) set(CONFIG_UBOOT_ARCH_TYPE "arm") set(CONFIG_LINUX_KERNEL_TYPE "arm") set(CONFIG_LINUX_APP_TYPE "arm") set(CONFIG_GREENBOX_ARCH_TYPE arm64) set(CONFIG_LINUX_TEXT_OFFSET "0x80208000") # uart start addr set(CONFIG_ESBC_UART_LINK_ADDR 0x15808020) # flash start addr set(CONFIG_ESBC_FLASH_LINK_ADDR 0x15809100) set(CONFIG_GREENBOX_LINK_ADDR 0x15809100) set(CONFIG_OVERLAY_BOARD_TYPE evb_hsan_16 evb_hsan_17 evb_hsan_18 evb_hsan_20 evb_hsan_21 evb_hsan_22 evb_hsan_23 evb_hsan_24 evb_hsan_25 evb_hsan_26 gpon_hsan_0 gpon_hsan_1 xgpon_hsan_12 xgpon_hsan_13 vendor5_xgpon5 vendor2_xgpon16 vendor3_xgpon0 vendor3_xgpon1 ) set(CONFIG_BOOT_UNSECBOOT ON) set(CONFIG_BUILD_IMAGE_HEAD ON) set(CONFIG_LINUX_DEFCONFIG hsan_cmcc_unify_defconfig) set(CONFIG_IP_VERSION_PRERT "v260") set(CONFIG_IP_VERSION_TRNG "3.0") set(CONFIG_IP_VERSION_SEC "spacc") set(CONFIG_IP_VERSION_KMS "km") set(CONFIG_IP_VERSION_CLK "2.0") set(CONFIG_IP_VERSION_CLK_TEST "1.0") set(CONFIG_IP_VERSION_HWDIO "2.0") set(CONFIG_IP_VERSION_CRYP "2.0") set(CONFIG_IP_VERSION_EFUSE "2.0") set(CONFIG_IP_VERSION_LSW_DP_SRC "v300") set(CONFIG_IP_VERSION_LSW_DP_INC "v300") set(CONFIG_IP_VERSION_LSW_PFE "v300") set(CONFIG_IP_VERSION_PCIE "v2") set(CONFIG_IP_VERSION_PINCTRL "2.0") set(CONFIG_IP_VERSION_NET_PON_GLB "v300") set(CONFIG_IP_VERSION_NET_PON_MAC "v300") set(CONFIG_TOOLCHAIN_ESBC "toolchain-aarch64-mix410-linux") set(CONFIG_TOOLCHAIN_UBOOT "toolchain-aarch64-mix410-linux") set(CONFIG_TOOLCHAIN_LINUX_DRV "toolchain-arm-mix510-linux") set(CONFIG_TOOLCHAIN_LINUX_APP "toolchain-arm-mix510-linux") set(CONFIG_TOOLCHAIN_ATF "toolchain-aarch64-mix410-linux") set(CONFIG_TOOLCHAIN_TEE_DRV "toolchain-arm-mix510-linux") set(CONFIG_TOOLCHAIN_TEE_SRV "toolchain-arm-mix510-linux") set(CONFIG_TOOLCHAIN_MVN "toolchain-apache-maven") set(CONFIG_TOOLCHAIN_LINX_XGE toolchain-cc_riscv32_musl) set(CONFIG_TOOLCHAIN_GREENBOX toolchain-aarch64-mix410-linux) set(CONFIG_TOOLCHIAN_SEL_HCC_ARM64LE ON) set(CONFIG_TOOLCHIAN_SEL_ARM_MIX510_LINUX ON) set(CONFIG_TOOLCHIAN_SEL_ARM_CC_RISCV32_MUSl OFF) set(CONFIG_TOOLCHIAN_SEL_ARM_XTENSA OFF) set(CONFIG_TOOLCHIAN_SEL_APACHE_MAVEN ON) set(CONFIG_TOOLCHIAN_SEL_ARM_AARCH64_MIX410_LINUX ON) 已知ubootb的偏移为0x140000,这里有体现吗?
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值