我試圖用立體聲立體聲產生低比特率的opus文件。什麼決定opusenc
將使用L/R立體聲而不是聯合立體聲?有我可以通過的國旗嗎?它與比特率有關嗎?強制立體聲立體聲
opusenc input.wav output.opus //produces L/R stereo
opusenc input.wav output.opus --bitrate 8 //produces joint stereo
我試圖用立體聲立體聲產生低比特率的opus文件。什麼決定opusenc
將使用L/R立體聲而不是聯合立體聲?有我可以通過的國旗嗎?它與比特率有關嗎?強制立體聲立體聲
opusenc input.wav output.opus //produces L/R stereo
opusenc input.wav output.opus --bitrate 8 //produces joint stereo
這些信息看樣子:
if (st->force_channels!=OPUS_AUTO && st->channels == 2)
{
st->stream_channels = st->force_channels;
} else {
#ifdef FUZZING
/* Random mono/stereo decision */
if (st->channels == 2 && (rand()&0x1F)==0)
st->stream_channels = 3-st->stream_channels;
#else
/* Rate-dependent mono-stereo decision */
if (st->channels == 2)
{
opus_int32 stereo_threshold;
stereo_threshold = stereo_music_threshold + ((voice_est*voice_est*(stereo_voice_threshold-stereo_music_threshold))>>14);
if (st->stream_channels == 2)
stereo_threshold -= 4000;
else
stereo_threshold += 4000;
st->stream_channels = (equiv_rate > stereo_threshold) ? 2 : 1;
} else {
st->stream_channels = st->channels;
}
#endif
}
通過opusenc源代碼只是breifly閱讀,它看起來像在struct OpusEncoder
設置force_channels
爲2將讓它起作用。但是,通過opusenc.c源代碼查看,沒有字段設置在哪裏。你可以很容易地修改源,但總是強制頻道爲兩個。對未來而言,Opus稱它爲「雙立體聲」而不是「L/R立體聲」。
上面粘貼的代碼會隨着編碼器決定在內部縮混爲單聲道而改變。確切的立體聲模式(L/R vs中側vs強度)在SILK和CELT代碼之間傳播,不是你應該惹的禍。我不確定原始帖子試圖達到什麼目的,但與立體聲模式混合可能不是這樣。 –
我正在通過編碼一個具有很高立體聲分離度的文件來測試這一點,並且聽取結果。通道與默認編碼明顯分開。 –