53 lines
1.8 KiB
C
53 lines
1.8 KiB
C
/*
|
|
* Copyright (C) 2026 Amlogic Corporation.
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef _AUDIO_SDEC_H_
|
|
#define _AUDIO_SDEC_H_
|
|
|
|
#include "audio_buffer.h"
|
|
|
|
struct aml_audio_device;
|
|
|
|
/*
|
|
* adev-owned surround decoder on the speaker path (TV/SBR only).
|
|
* out_mask is always real_spk_layout_mask (or STEREO on 2ch speaker).
|
|
* Called from aml_audio_pcm_output; identity when in_mask == out_mask.
|
|
*/
|
|
|
|
int audio_sdec_init(struct aml_audio_device *adev);
|
|
void audio_sdec_deinit(struct aml_audio_device *adev);
|
|
|
|
/*
|
|
* Convert in -> speaker layout packed PCM.
|
|
* Returns 0 and fills *out (may alias in on passthrough).
|
|
* Returns -1 on skip/fail; *out is left unchanged.
|
|
*/
|
|
int audio_sdec_process(struct aml_audio_device *adev,
|
|
struct audio_buffer *in,
|
|
struct audio_buffer *out);
|
|
|
|
/*
|
|
* Remap MS12 DAP raw packed PCM to acmod/lfe layout.
|
|
* in->channel is packed stride (set by caller from MS12 2.4/2.8).
|
|
* in->channel_mask must already be the destination acmod/lfe mask.
|
|
* Returns 0 when *out is filled; -1 to keep the original buffer.
|
|
*/
|
|
int audio_sdec_remap_ms12_dap_raw(struct aml_audio_device *adev,
|
|
struct audio_buffer *in,
|
|
struct audio_buffer *out);
|
|
|
|
#endif /* _AUDIO_SDEC_H_ */
|