FFmpeg: libavcodec/dca_lbr.h Source File
Go to the documentation of this file. 1 /*
2 * Copyright (C) 2016 foo86
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef AVCODEC_DCA_LBR_H
22 #define AVCODEC_DCA_LBR_H
23
27
33
34 #define DCA_LBR_CHANNELS 6
35 #define DCA_LBR_CHANNELS_TOTAL 32
36 #define DCA_LBR_SUBBANDS 32
37 #define DCA_LBR_TONES 512
38
39 #define DCA_LBR_TIME_SAMPLES 128
40 #define DCA_LBR_TIME_HISTORY 8
41
45 };
46
48 uint8_t
x_freq;
///< Spectral line offset
49 uint8_t
f_delt;
///< Difference between original and center frequency
51 uint8_t
pad;
///< Padding field
55
59
62 int flags;
///< Flags for LBR decoder initialization
65
66 int nchannels;
///< Number of fullband channels to decode
77
78 int framenum;
///< Lower 5 bits of current frame number
79 int lbr_rand;
///< Seed for subband randomization
80 int warned;
///< Flags for warning suppression
81
84
88
91
95
97
100
102
104
106
108 unsigned int ts_size;
///< Time sample buffer size
109
112
115 float lfe_scale;
///< Scale factor of LFE samples before IIR filter
116
118 uint16_t
tonal_bounds[5][32][2];
///< Per-group per-subframe start/end positions of tones
120 int ntones;
///< Circular buffer head position
121
127
134
135 #endif
int bit_rate_orig
Original bit rate.
float * ts_buffer
Time sample buffer base.
int min_mono_subband
Subband index where mono encoding starts.
int ch_mask
LBR speaker mask.
float lfe_history[5][2]
LFE IIR filter history.
av_cold void ff_dca_lbr_init_tables(void)
This structure describes decoded (raw) audio or video data.
DCALbrTone tones[DCA_LBR_TONES]
Circular buffer of tones.
uint8_t phs[DCA_LBR_CHANNELS]
Per-channel phase.
uint8_t x_freq
Spectral line offset.
uint8_t grid_2_scf[DCA_LBR_CHANNELS][3][64]
Grid 2 scale factors.
int max_mono_subband
Subband index where mono encoding ends.
uint8_t amp[DCA_LBR_CHANNELS]
Per-channel amplitude.
uint8_t part_stereo[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS/4][5]
Partial stereo coefficients.
int nchannels_total
Total number of fullband channels.
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
int g3_avg_only_start_sb
Subband index where grid 3 scale factors end.
int res_profile
Resolution profile.
uint8_t tonal_scf[6]
Tonal scale factors.
float window[DCA_LBR_SUBBANDS *4]
Long window for IMDCT.
int8_t grid_3_scf[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS - 4][8]
Grid 3 scale factors.
int freq_range
Frequency range of LBR audio.
int nchannels
Number of fullband channels to decode.
int limited_range
Band limited frequency range.
uint8_t sec_ch_sbms[DCA_LBR_CHANNELS/2][DCA_LBR_SUBBANDS]
Right channel inversion or mid/side decoding flags.
uint16_t tonal_bounds[5][32][2]
Per-group per-subframe start/end positions of tones.
float lfe_scale
Scale factor of LFE samples before IIR filter.
uint8_t part_stereo_pres
Partial stereo coefficients presence flags.
int warned
Flags for warning suppression.
av_cold void ff_dca_lbr_close(DCALbrDecoder *s)
@ DCA_LBR_HEADER_SYNC_ONLY
uint8_t ph_rot
Phase rotation.
float lfe_data[64]
Decimated LFE samples.
#define DECLARE_ALIGNED(n, t, v)
int sample_rate
Sample rate of LBR audio.
int lbr_rand
Seed for subband randomization.
uint8_t sb_indices[DCA_LBR_SUBBANDS]
Subband reordering indices.
@ DCA_LBR_HEADER_DECODER_INIT
uint8_t f_delt
Difference between original and center frequency.
int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame)
uint8_t sec_ch_lrms[DCA_LBR_CHANNELS/2][DCA_LBR_SUBBANDS]
Flags indicating if left/right channel are swapped.
uint32_t grid_3_pres[DCA_LBR_CHANNELS]
Grid 3 scale factors presence flags.
uint32_t ch_pres[DCA_LBR_CHANNELS]
Subband allocation flags.
int band_limit
Band limit factor.
int nsubbands
Number of encoded subbands.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
uint8_t quant_levels[DCA_LBR_CHANNELS/2][DCA_LBR_SUBBANDS]
Quantization levels.
int bit_rate_scaled
Scaled bit rate.
main external API structure.
av_cold void ff_dca_lbr_flush(DCALbrDecoder *s)
int8_t grid_3_avg[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS - 4]
Grid 3 average values.
unsigned int ts_size
Time sample buffer size.
int flags
Flags for LBR decoder initialization.
int limited_rate
Band limited sample rate.
float lpc_coeff[2][DCA_LBR_CHANNELS][3][2][8]
Predictor coefficients.
int framenum
Lower 5 bits of current frame number.
uint8_t high_res_scf[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS][8]
High-frequency resolution scale factors.
uint8_t grid_1_scf[DCA_LBR_CHANNELS][12][8]
Grid 1 scale factors.
int ntones
Circular buffer head position.
av_cold int ff_dca_lbr_init(DCALbrDecoder *s)
uint8_t pad
Padding field.
float * time_samples[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS]
Time samples.
int ff_dca_lbr_parse(DCALbrDecoder *s, const uint8_t *data, DCAExssAsset *asset)
float history[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS *4]
IMDCT history.
float sb_scf[DCA_LBR_SUBBANDS]
Subband randomization scale factors.
Generated on Fri Aug 22 2025 13:58:15 for FFmpeg by
doxygen
1.8.17