--- configure | 1 - libavcodec/Makefile | 3 - libavcodec/aarch64/Makefile | 3 - libavcodec/aarch64/dcadsp_init.c | 15 +- libavcodec/aarch64/dcadsp_neon.S | 109 -- libavcodec/allcodecs.c | 2 +- libavcodec/arm/Makefile | 5 - libavcodec/arm/dca.h | 1 - libavcodec/arm/dcadsp_init_arm.c | 30 +- libavcodec/arm/dcadsp_neon.S | 64 -- libavcodec/arm/dcadsp_vfp.S | 476 --------- libavcodec/dca.h | 287 +----- libavcodec/dca_exss.c | 373 ------- libavcodec/dca_xll.c | 747 -------------- libavcodec/dcadata.c | 318 ------ libavcodec/dcadata.h | 10 - libavcodec/dcadec.c | 2067 -------------------------------------- libavcodec/dcadsp.c | 134 --- libavcodec/dcadsp.h | 51 - libavcodec/dcamath.h | 42 - libavcodec/x86/Makefile | 2 - libavcodec/x86/dcadsp.asm | 99 -- libavcodec/x86/dcadsp_init.c | 21 +- 23 files changed, 6 insertions(+), 4854 deletions(-) delete mode 100644 libavcodec/aarch64/dcadsp_neon.S delete mode 100644 libavcodec/arm/dcadsp_neon.S delete mode 100644 libavcodec/arm/dcadsp_vfp.S delete mode 100644 libavcodec/dca_exss.c delete mode 100644 libavcodec/dca_xll.c delete mode 100644 libavcodec/dcadec.c delete mode 100644 libavcodec/dcadsp.c delete mode 100644 libavcodec/dcadsp.h delete mode 100644 libavcodec/dcamath.h
diff --git a/configure b/configure index 28ec5bf..9324d43 100755 --- a/configure +++ b/configure @@ -2276,7 +2276,6 @@ comfortnoise_encoder_select="lpc" cook_decoder_select="audiodsp mdct sinewin" cscd_decoder_select="lzo" cscd_decoder_suggest="zlib" -dca_decoder_select="fmtconvert mdct" dds_decoder_select="texturedsp" dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc" dnxhd_decoder_select="blockdsp idctdsp" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index b9ffdb9..20d26e5 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -221,9 +221,6 @@ OBJS-$(CONFIG_COMFORTNOISE_ENCODER) += cngenc.o OBJS-$(CONFIG_CPIA_DECODER) += cpia.o OBJS-$(CONFIG_CSCD_DECODER) += cscd.o OBJS-$(CONFIG_CYUV_DECODER) += cyuv.o -OBJS-$(CONFIG_DCA_DECODER) += dcadec.o dca.o dcadsp.o \ - dcadata.o dca_exss.o \ - dca_xll.o synth_filter.o OBJS-$(CONFIG_DCA_ENCODER) += dcaenc.o dca.o dcadata.o OBJS-$(CONFIG_DDS_DECODER) += dds.o OBJS-$(CONFIG_DIRAC_DECODER) += diracdec.o dirac.o diracdsp.o \ diff --git a/libavcodec/aarch64/Makefile b/libavcodec/aarch64/Makefile index 022ed84..0ad8ac9 100644 --- a/libavcodec/aarch64/Makefile +++ b/libavcodec/aarch64/Makefile @@ -1,4 +1,3 @@ -OBJS-$(CONFIG_DCA_DECODER) += aarch64/dcadsp_init.o OBJS-$(CONFIG_FFT) += aarch64/fft_init_aarch64.o OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_init.o OBJS-$(CONFIG_H264CHROMA) += aarch64/h264chroma_init_aarch64.o @@ -17,8 +16,6 @@ OBJS-$(CONFIG_VORBIS_DECODER) += aarch64/vorbisdsp_init.o ARMV8-OBJS-$(CONFIG_VIDEODSP) += aarch64/videodsp.o -NEON-OBJS-$(CONFIG_DCA_DECODER) += aarch64/dcadsp_neon.o \ - aarch64/synth_filter_neon.o NEON-OBJS-$(CONFIG_FFT) += aarch64/fft_neon.o NEON-OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_neon.o NEON-OBJS-$(CONFIG_H264CHROMA) += aarch64/h264cmc_neon.o diff --git a/libavcodec/aarch64/dcadsp_init.c b/libavcodec/aarch64/dcadsp_init.c index 78642a5..c8d3c77 100644 --- a/libavcodec/aarch64/dcadsp_init.c +++ b/libavcodec/aarch64/dcadsp_init.c @@ -23,7 +23,7 @@ #include "libavutil/aarch64/cpu.h" #include "libavutil/attributes.h" #include "libavutil/internal.h" -#include "libavcodec/dcadsp.h" +#include "libavcodec/synth_filter.h" #include "libavcodec/fft.h" #include "asm-offsets.h" @@ -32,25 +32,12 @@ AV_CHECK_OFFSET(FFTContext, imdct_half, IMDCT_HALF); #endif -void ff_dca_lfe_fir0_neon(float *out, const float *in, const float *coefs); -void ff_dca_lfe_fir1_neon(float *out, const float *in, const float *coefs); - void ff_synth_filter_float_neon(FFTContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, float synth_buf2[32], const float window[512], float out[32], const float in[32], float scale); -av_cold void ff_dcadsp_init_aarch64(DCADSPContext *s) -{ - int cpu_flags = av_get_cpu_flags(); - - if (have_neon(cpu_flags)) { - s->lfe_fir[0] = ff_dca_lfe_fir0_neon; - s->lfe_fir[1] = ff_dca_lfe_fir1_neon; - } -} - av_cold void ff_synth_filter_init_aarch64(SynthFilterContext *s) { int cpu_flags = av_get_cpu_flags(); diff --git a/libavcodec/aarch64/dcadsp_neon.S b/libavcodec/aarch64/dcadsp_neon.S deleted file mode 100644 index 0426dc6..0000000 diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 2128546..8b42098 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -387,7 +387,7 @@ void avcodec_register_all(void) REGISTER_DECODER(BINKAUDIO_RDFT, binkaudio_rdft); REGISTER_DECODER(BMV_AUDIO, bmv_audio); REGISTER_DECODER(COOK, cook); - REGISTER_ENCDEC (DCA, dca); + REGISTER_ENCODER(DCA, dca); REGISTER_DECODER(DSD_LSBF, dsd_lsbf); REGISTER_DECODER(DSD_MSBF, dsd_msbf); REGISTER_DECODER(DSD_LSBF_PLANAR, dsd_lsbf_planar); diff --git a/libavcodec/arm/Makefile b/libavcodec/arm/Makefile index cdd35b0..e04eb1a 100644 --- a/libavcodec/arm/Makefile +++ b/libavcodec/arm/Makefile @@ -36,7 +36,6 @@ OBJS-$(CONFIG_VP8DSP) += arm/vp8dsp_init_arm.o # decoders/encoders OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_init_arm.o \ arm/sbrdsp_init_arm.o -OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_init_arm.o OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_arm.o OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o OBJS-$(CONFIG_RV40_DECODER) += arm/rv40dsp_init_arm.o @@ -87,8 +86,6 @@ VFP-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_vfp.o VFP-OBJS-$(CONFIG_MDCT) += arm/mdct_vfp.o # decoders/encoders -VFP-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_vfp.o \ - arm/synth_filter_vfp.o # NEON optimizations @@ -127,8 +124,6 @@ NEON-OBJS-$(CONFIG_VP8DSP) += arm/vp8dsp_init_neon.o \ NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_neon.o \ arm/sbrdsp_neon.o NEON-OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_neon.o -NEON-OBJS-$(CONFIG_DCA_DECODER) += arm/dcadsp_neon.o \ - arm/synth_filter_neon.o NEON-OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_neon.o \ arm/hevcdsp_deblock_neon.o \ arm/hevcdsp_idct_neon.o \ diff --git a/libavcodec/arm/dca.h b/libavcodec/arm/dca.h index 6e87111..ae4b730 100644 --- a/libavcodec/arm/dca.h +++ b/libavcodec/arm/dca.h @@ -24,7 +24,6 @@ #include <stdint.h> #include "config.h" -#include "libavcodec/dcadsp.h" #include "libavcodec/mathops.h" #if HAVE_ARMV6_INLINE && AV_GCC_VERSION_AT_LEAST(4,4) && !CONFIG_THUMB diff --git a/libavcodec/arm/dcadsp_init_arm.c b/libavcodec/arm/dcadsp_init_arm.c index 0f2e4c4..3dae5b9 100644 --- a/libavcodec/arm/dcadsp_init_arm.c +++ b/libavcodec/arm/dcadsp_init_arm.c @@ -22,20 +22,7 @@ #include "libavutil/arm/cpu.h" #include "libavutil/attributes.h" -#include "libavcodec/dcadsp.h" - -void ff_dca_lfe_fir0_neon(float *out, const float *in, const float *coefs); -void ff_dca_lfe_fir1_neon(float *out, const float *in, const float *coefs); - -void ff_dca_lfe_fir32_vfp(float *out, const float *in, const float *coefs); -void ff_dca_lfe_fir64_vfp(float *out, const float *in, const float *coefs); - -void ff_dca_qmf_32_subbands_vfp(float samples_in[32][8], int sb_act, - SynthFilterContext *synth, FFTContext *imdct, - float synth_buf_ptr[512], - int *synth_buf_offset, float synth_buf2[32], - const float window[512], float *samples_out, - float raXin[32], float scale); +#include "libavcodec/synth_filter.h" void ff_synth_filter_float_vfp(FFTContext *imdct, float *synth_buf_ptr, int *synth_buf_offset, @@ -49,21 +36,6 @@ void ff_synth_filter_float_neon(FFTContext *imdct, float out[32], const float in[32], float scale); -av_cold void ff_dcadsp_init_arm(DCADSPContext *s) -{ - int cpu_flags = av_get_cpu_flags(); - - if (have_vfp_vm(cpu_flags)) { - s->lfe_fir[0] = ff_dca_lfe_fir32_vfp; - s->lfe_fir[1] = ff_dca_lfe_fir64_vfp; - s->qmf_32_subbands = ff_dca_qmf_32_subbands_vfp; - } - if (have_neon(cpu_flags)) { - s->lfe_fir[0] = ff_dca_lfe_fir0_neon; - s->lfe_fir[1] = ff_dca_lfe_fir1_neon; - } -} - av_cold void ff_synth_filter_init_arm(SynthFilterContext *s) { int cpu_flags = av_get_cpu_flags(); diff --git a/libavcodec/arm/dcadsp_neon.S b/libavcodec/arm/dcadsp_neon.S deleted file mode 100644 index 101fee0..0000000 diff --git a/libavcodec/arm/dcadsp_vfp.S b/libavcodec/arm/dcadsp_vfp.S deleted file mode 100644 index 2e09f0e..0000000 diff --git a/libavcodec/dca.h b/libavcodec/dca.h index dea82ae..ea3f9c5 100644 --- a/libavcodec/dca.h +++ b/libavcodec/dca.h @@ -27,282 +27,8 @@ #include <stdint.h> -#include "libavutil/float_dsp.h" #include "libavutil/internal.h" - -#include "avcodec.h" -#include "dcadsp.h" -#include "fmtconvert.h" -#include "get_bits.h" - -#define DCA_PRIM_CHANNELS_MAX (7) -#define DCA_ABITS_MAX (32) /* Should be 28 */ -#define DCA_SUBSUBFRAMES_MAX (4) -#define DCA_SUBFRAMES_MAX (16) -#define DCA_BLOCKS_MAX (16) -#define DCA_LFE_MAX (3) -#define DCA_CHSETS_MAX (4) -#define DCA_CHSET_CHANS_MAX (8) - -#define DCA_PRIM_CHANNELS_MAX (7) -#define DCA_ABITS_MAX (32) /* Should be 28 */ -#define DCA_SUBSUBFRAMES_MAX (4) -#define DCA_SUBFRAMES_MAX (16) -#define DCA_BLOCKS_MAX (16) -#define DCA_LFE_MAX (3) -#define DCA_XLL_FBANDS_MAX (4) -#define DCA_XLL_SEGMENTS_MAX (16) -#define DCA_XLL_CHSETS_MAX (16) -#define DCA_XLL_CHANNELS_MAX (16) -#define DCA_XLL_AORDER_MAX (15) - -/* Arbitrary limit; not sure what the maximum really is, but much larger. */ -#define DCA_XLL_DMIX_NCOEFFS_MAX (18) - -#define DCA_MAX_FRAME_SIZE 16384 -#define DCA_MAX_EXSS_HEADER_SIZE 4096 - -#define DCA_BUFFER_PADDING_SIZE 1024 - -enum DCAExtensionMask { - DCA_EXT_CORE = 0x001, ///< core in core substream - DCA_EXT_XXCH = 0x002, ///< XXCh channels extension in core substream - DCA_EXT_X96 = 0x004, ///< 96/24 extension in core substream - DCA_EXT_XCH = 0x008, ///< XCh channel extension in core substream - DCA_EXT_EXSS_CORE = 0x010, ///< core in ExSS (extension substream) - DCA_EXT_EXSS_XBR = 0x020, ///< extended bitrate extension in ExSS - DCA_EXT_EXSS_XXCH = 0x040, ///< XXCh channels extension in ExSS - DCA_EXT_EXSS_X96 = 0x080, ///< 96/24 extension in ExSS - DCA_EXT_EXSS_LBR = 0x100, ///< low bitrate component in ExSS - DCA_EXT_EXSS_XLL = 0x200, ///< lossless extension in ExSS -}; - -typedef struct XllChSetSubHeader { - int channels; ///< number of channels in channel set, at most 16 - int residual_encode; ///< residual channel encoding - int bit_resolution; ///< input sample bit-width - int bit_width; ///< original input sample bit-width - int sampling_frequency; ///< sampling frequency - int samp_freq_interp; ///< sampling frequency interpolation multiplier - int replacement_set; ///< replacement channel set group - int active_replace_set; ///< current channel set is active channel set - int primary_ch_set; - int downmix_coeff_code_embedded; - int downmix_embedded; - int downmix_type; - int hier_chset; ///< hierarchical channel set - int downmix_ncoeffs; - int downmix_coeffs[DCA_XLL_DMIX_NCOEFFS_MAX]; - int ch_mask_enabled; - int ch_mask; - int mapping_coeffs_present; - int num_freq_bands; - - /* m_nOrigChanOrder */ - uint8_t orig_chan_order[DCA_XLL_FBANDS_MAX][DCA_XLL_CHANNELS_MAX]; - uint8_t orig_chan_order_inv[DCA_XLL_FBANDS_MAX][DCA_XLL_CHANNELS_MAX]; - /* Coefficients for channel pairs (at most 8), m_anPWChPairsCoeffs */ - int8_t pw_ch_pairs_coeffs[DCA_XLL_FBANDS_MAX][DCA_XLL_CHANNELS_MAX/2]; - /* m_nCurrHighestLPCOrder */ - uint8_t adapt_order_max[DCA_XLL_FBANDS_MAX]; - /* m_pnAdaptPredOrder */ - uint8_t adapt_order[DCA_XLL_FBANDS_MAX][DCA_XLL_CHANNELS_MAX]; - /* m_pnFixedPredOrder */ - uint8_t fixed_order[DCA_XLL_FBANDS_MAX][DCA_XLL_CHANNELS_MAX]; - /* m_pnLPCReflCoeffsQInd, unsigned version */ - uint8_t lpc_refl_coeffs_q_ind[DCA_XLL_FBANDS_MAX] - [DCA_XLL_CHANNELS_MAX][DCA_XLL_AORDER_MAX]; - - int lsb_fsize[DCA_XLL_FBANDS_MAX]; - int8_t scalable_lsbs[DCA_XLL_FBANDS_MAX][DCA_XLL_CHANNELS_MAX]; - int8_t bit_width_adj_per_ch[DCA_XLL_FBANDS_MAX][DCA_XLL_CHANNELS_MAX]; -} XllChSetSubHeader; - -typedef struct XllNavi { - GetBitContext gb; // Context for parsing the data segments - unsigned band_size[DCA_XLL_FBANDS_MAX]; - unsigned segment_size[DCA_XLL_FBANDS_MAX][DCA_XLL_SEGMENTS_MAX]; - unsigned chset_size[DCA_XLL_FBANDS_MAX][DCA_XLL_SEGMENTS_MAX][DCA_XLL_CHSETS_MAX]; -} XllNavi; - -typedef struct QMF64_table { - float dct4_coeff[32][32]; - float dct2_coeff[32][32]; - float rcos[32]; - float rsin[32]; -} QMF64_table; - -/* Primary audio coding header */ -typedef struct DCAAudioHeader { - int subband_activity[DCA_PRIM_CHANNELS_MAX]; ///< subband activity count - int vq_start_subband[DCA_PRIM_CHANNELS_MAX]; ///< high frequency vq start subband - int joint_intensity[DCA_PRIM_CHANNELS_MAX]; ///< joint intensity coding index - int transient_huffman[DCA_PRIM_CHANNELS_MAX]; ///< transient mode code book - int scalefactor_huffman[DCA_PRIM_CHANNELS_MAX]; ///< scale factor code book - int bitalloc_huffman[DCA_PRIM_CHANNELS_MAX]; ///< bit allocation quantizer select - int quant_index_huffman[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX]; ///< quantization index codebook select - uint32_t scalefactor_adj[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX]; ///< scale factor adjustment - - int subframes; ///< number of subframes - int total_channels; ///< number of channels including extensions - int prim_channels; ///< number of primary audio channels -} DCAAudioHeader; - -typedef struct DCAChan { - DECLARE_ALIGNED(32, int32_t, subband_samples)[DCA_BLOCKS_MAX][DCA_SUBBANDS][SAMPLES_PER_SUBBAND]; - - /* Subband samples history (for ADPCM) */ - DECLARE_ALIGNED(32, int32_t, subband_samples_hist)[DCA_SUBBANDS][4]; - int hist_index; - - /* Half size is sufficient for core decoding, but for 96 kHz data - * we need QMF with 64 subbands and 1024 samples. */ - DECLARE_ALIGNED(32, float, subband_fir_hist)[1024]; - DECLARE_ALIGNED(32, float, subband_fir_noidea)[64]; - - /* Primary audio coding side information */ - int prediction_mode[DCA_SUBBANDS]; ///< prediction mode (ADPCM used or not) - int prediction_vq[DCA_SUBBANDS]; ///< prediction VQ coefs - int bitalloc[DCA_SUBBANDS]; ///< bit allocation index - int transition_mode[DCA_SUBBANDS]; ///< transition mode (transients) - int32_t scale_factor[DCA_SUBBANDS][2];///< scale factors (2 if transient) - int joint_huff; ///< joint subband scale factors codebook - int joint_scale_factor[DCA_SUBBANDS]; ///< joint subband scale factors - - int32_t high_freq_vq[DCA_SUBBANDS]; ///< VQ encoded high frequency subbands -} DCAChan; - - -typedef struct DCAContext { - const AVClass *class; ///< class for AVOptions - AVCodecContext *avctx; - /* Frame header */ - int frame_type; ///< type of the current frame - int samples_deficit; ///< deficit sample count - int crc_present; ///< crc is present in the bitstream - int sample_blocks; ///< number of PCM sample blocks - int frame_size; ///< primary frame byte size - int amode; ///< audio channels arrangement - int sample_rate; ///< audio sampling rate - int bit_rate; ///< transmission bit rate - int bit_rate_index; ///< transmission bit rate index - - int dynrange; ///< embedded dynamic range flag - int timestamp; ///< embedded time stamp flag - int aux_data; ///< auxiliary data flag - int hdcd; ///< source material is mastered in HDCD - int ext_descr; ///< extension audio descriptor flag - int ext_coding; ///< extended coding flag - int aspf; ///< audio sync word insertion flag - int lfe; ///< low frequency effects flag - int predictor_history; ///< predictor history flag - int header_crc; ///< header crc check bytes - int multirate_inter; ///< multirate interpolator switch - int version; ///< encoder software revision - int copy_history; ///< copy history - int source_pcm_res; ///< source pcm resolution - int front_sum; ///< front sum/difference flag - int surround_sum; ///< surround sum/difference flag - int dialog_norm; ///< dialog normalisation parameter - - /* Primary audio coding header */ - DCAAudioHeader audio_header; - - /* Primary audio coding side information */ - int subsubframes[DCA_SUBFRAMES_MAX]; ///< number of subsubframes - int partial_samples[DCA_SUBFRAMES_MAX]; ///< partial subsubframe samples count - float downmix_coef[DCA_PRIM_CHANNELS_MAX + 1][2]; ///< stereo downmix coefficients - int dynrange_coef; ///< dynamic range coefficient - - /* Core substream's embedded downmix coefficients (cf. ETSI TS 102 114 V1.4.1) - * Input: primary audio channels (incl. LFE if present) - * Output: downmix audio channels (up to 4, no LFE) */ - uint8_t core_downmix; ///< embedded downmix coefficients available - uint8_t core_downmix_amode; ///< audio channel arrangement of embedded downmix - uint16_t core_downmix_codes[DCA_PRIM_CHANNELS_MAX + 1][4]; ///< embedded downmix coefficients (9-bit codes) - - - float lfe_data[2 * DCA_LFE_MAX * (DCA_BLOCKS_MAX + 4)]; ///< Low frequency effect data - int lfe_scale_factor; - - /* Subband samples history (for ADPCM) */ - DECLARE_ALIGNED(32, float, raXin)[32]; - - DCAChan dca_chan[DCA_PRIM_CHANNELS_MAX]; - - int output; ///< type of output - - float *samples_chanptr[DCA_PRIM_CHANNELS_MAX + 1]; - float *extra_channels[DCA_PRIM_CHANNELS_MAX + 1]; - uint8_t *extra_channels_buffer; - unsigned int extra_channels_buffer_size; - - uint8_t dca_buffer[DCA_MAX_FRAME_SIZE + DCA_MAX_EXSS_HEADER_SIZE + DCA_BUFFER_PADDING_SIZE]; - int dca_buffer_size; ///< how much data is in the dca_buffer - - const int8_t *channel_order_tab; ///< channel reordering table, lfe and non lfe - GetBitContext gb; - /* Current position in DCA frame */ - int current_subframe; - int current_subsubframe; - - int core_ext_mask; ///< present extensions in the core substream - int exss_ext_mask; ///< Non-core extensions - - /* XCh extension information */ - int xch_present; ///< XCh extension present and valid - int xch_base_channel; ///< index of first (only) channel containing XCH data - int xch_disable; ///< whether the XCh extension should be decoded or not - - /* XXCH extension information */ - int xxch_chset; - int xxch_nbits_spk_mask; - uint32_t xxch_core_spkmask; - uint32_t xxch_spk_masks[4]; /* speaker masks, last element is core mask */ - int xxch_chset_nch[4]; - float xxch_dmix_sf[DCA_CHSETS_MAX]; - - uint32_t xxch_dmix_embedded; /* lower layer has mix pre-embedded, per chset */ - float xxch_dmix_coeff[DCA_PRIM_CHANNELS_MAX][32]; /* worst case sizing */ - - int8_t xxch_order_tab[32]; - int8_t lfe_index; - - /* XLL extension information */ - int xll_disable; - int xll_nch_sets; ///< number of channel sets per frame - int xll_channels; ///< total number of channels (in all channel sets) - int xll_residual_channels; ///< number of residual channels - int xll_segments; ///< number of segments per frame - int xll_log_smpl_in_seg; ///< supposedly this is "nBits4SamplLoci" - int xll_smpl_in_seg; ///< samples in segment per one frequency band for the first channel set - int xll_bits4seg_size; ///< number of bits used to read segment size - int xll_banddata_crc; ///< presence of CRC16 within each frequency band - int xll_scalable_lsb; - int xll_bits4ch_mask; ///< channel position mask - int xll_fixed_lsb_width; - XllChSetSubHeader xll_chsets[DCA_XLL_CHSETS_MAX]; - XllNavi xll_navi; - int *xll_sample_buf; - unsigned int xll_sample_buf_size; - - /* ExSS header parser */ - int static_fields; ///< static fields present - int mix_metadata; ///< mixing metadata present - int num_mix_configs; ///< number of mix out configurations - int mix_config_num_ch[4]; ///< number of channels in each mix out configuration - - int profile; - int one2one_map_chtospkr; - - int debug_flag; ///< used for suppressing repeated error messages output - AVFloatDSPContext *fdsp; - FFTContext imdct; - SynthFilterContext synth; - DCADSPContext dcadsp; - QMF64_table *qmf64_table; - FmtConvertContext fmt_conv; -} DCAContext; +#include "libavutil/intreadwrite.h" extern av_export const uint32_t avpriv_dca_sample_rates[16]; @@ -310,15 +36,6 @@ extern av_export const uint32_t avpriv_dca_sample_rates[16]; * Convert bitstream to one representation based on sync marker */ int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, - int max_size); - -int ff_dca_xbr_parse_frame(DCAContext *s); -int ff_dca_xxch_decode_frame(DCAContext *s); - -void ff_dca_exss_parse_header(DCAContext *s); - -int ff_dca_xll_decode_header(DCAContext *s); -int ff_dca_xll_decode_navi(DCAContext *s, int asset_end); -int ff_dca_xll_decode_audio(DCAContext *s, AVFrame *frame); + int max_size); #endif /* AVCODEC_DCA_H */ diff --git a/libavcodec/dca_exss.c b/libavcodec/dca_exss.c deleted file mode 100644 index ed01490..0000000 diff --git a/libavcodec/dca_xll.c b/libavcodec/dca_xll.c deleted file mode 100644 index 98fd4c8..0000000 diff --git a/libavcodec/dcadata.c b/libavcodec/dcadata.c index af2c75b..0d0c218 100644 --- a/libavcodec/dcadata.c +++ b/libavcodec/dcadata.c @@ -22,7 +22,6 @@ #include <stdint.h> -#include "libavutil/channel_layout.h" #include "libavutil/mem.h" #include "dca.h" @@ -7509,76 +7508,6 @@ DECLARE_ALIGNED(16, const float, ff_dca_lfe_fir_128)[256] = { }; #undef SCALE - -#define SCALE(c) ((float)(c) / (256.0f * 32768.0f * 8388608.0f)) -DECLARE_ALIGNED(16, const float, ff_dca_lfe_xll_fir_64)[256] = { - SCALE( 6103), SCALE( 52170), SCALE(-558064), SCALE(1592440), - SCALE(6290049), SCALE(1502534), SCALE(-546669), SCALE( 53047), - SCALE( 1930), SCALE( 51089), SCALE(-568920), SCALE(1683709), - SCALE(6286575), SCALE(1414057), SCALE(-534782), SCALE( 53729), - SCALE( 2228), SCALE( 49794), SCALE(-579194), SCALE(1776276), - SCALE(6279634), SCALE(1327070), SCALE(-522445), SCALE( 54228), - SCALE( 2552), SCALE( 48275), SCALE(-588839), SCALE(1870070), - SCALE(6269231), SCALE(1241632), SCALE(-509702), SCALE( 54550), - SCALE( 2904), SCALE( 46523), SCALE(-597808), SCALE(1965017), - SCALE(6255380), SCALE(1157798), SCALE(-496595), SCALE( 54708), - SCALE( 3287), SCALE( 44529), SCALE(-606054), SCALE(2061044), - SCALE(6238099), SCALE(1075621), SCALE(-483164), SCALE( 54710), - SCALE( 3704), SCALE( 42282), SCALE(-613529), SCALE(2158071), - SCALE(6217408), SCALE( 995149), SCALE(-469451), SCALE( 54566), - SCALE( 4152), SCALE( 39774), SCALE(-620186), SCALE(2256019), - SCALE(6193332), SCALE( 916430), SCALE(-455494), SCALE( 54285), - SCALE( 4631), SCALE( 36995), SCALE(-625976), SCALE(2354805), - SCALE(6165900), SCALE( 839507), SCALE(-441330), SCALE( 53876), - SCALE( 5139), SCALE( 33937), SCALE(-630850), SCALE(2454343), - SCALE(6135146), SCALE( 764419), SCALE(-426998), SCALE( 53348), - SCALE( 5682), SCALE( 30591), SCALE(-634759), SCALE(2554547), - SCALE(6101107), SCALE( 691203), SCALE(-412531), SCALE( 52711), - SCALE( 6264), SCALE( 26948), SCALE(-637655), SCALE(2655326), - SCALE(6063824), SCALE( 619894), SCALE(-397966), SCALE( 51972), - SCALE( 6886), SCALE( 23001), SCALE(-639488), SCALE(2756591), - SCALE(6023343), SCALE( 550521), SCALE(-383335), SCALE( 51140), - SCALE( 7531), SCALE( 18741), SCALE(-640210), SCALE(2858248), - SCALE(5979711), SCALE( 483113), SCALE(-368671), SCALE( 50224), - SCALE( 8230), SCALE( 14162), SCALE(-639772), SCALE(2960201), - SCALE(5932981), SCALE( 417692), SCALE(-354003), SCALE( 49231), - SCALE( 8959), SCALE( 9257), SCALE(-638125), SCALE(3062355), - SCALE(5883210), SCALE( 354281), SCALE(-339362), SCALE( 48168), - SCALE( 9727), SCALE( 4018), SCALE(-635222), SCALE(3164612), - SCALE(5830457), SCALE( 292897), SCALE(-324777), SCALE( 47044), - SCALE( 10535), SCALE( -1558), SCALE(-631014), SCALE(3266872), - SCALE(5774785), SCALE( 233555), SCALE(-310273), SCALE( 45866), - SCALE( 11381), SCALE( -7480), SCALE(-625455), SCALE(3369035), - SCALE(5716260), SCALE( 176267), SCALE(-295877), SCALE( 44640), - SCALE( 12267), SCALE( -13750), SCALE(-618499), SCALE(3471000), - SCALE(5654952), SCALE( 121042), SCALE(-281613), SCALE( 43373), - SCALE( 13190), SCALE( -20372), SCALE(-610098), SCALE(3572664), - SCALE(5590933), SCALE( 67886), SCALE(-267505), SCALE( 42072), - SCALE( 14152), SCALE( -27352), SCALE(-600209), SCALE(3673924), - SCALE(5524280), SCALE( 16800), SCALE(-253574), SCALE( 40743), - SCALE( 15153), SCALE( -34691), SCALE(-588788), SCALE(3774676), - SCALE(5455069), SCALE( -32214), SCALE(-239840), SCALE( 39391), - SCALE( 16192), SCALE( -42390), SCALE(-575791), SCALE(3874816), - SCALE(5383383), SCALE( -79159), SCALE(-226323), SCALE( 38022), - SCALE( 17267), SCALE( -50453), SCALE(-561178), SCALE(3974239), - SCALE(5309305), SCALE(-124041), SCALE(-213041), SCALE( 36642), - SCALE( 18377), SCALE( -58879), SCALE(-544906), SCALE(4072841), - SCALE(5232922), SCALE(-166869), SCALE(-200010), SCALE( 35256), - SCALE( 19525), SCALE( -67667), SCALE(-526937), SCALE(4170517), - SCALE(5154321), SCALE(-207653), SCALE(-187246), SCALE( 33866), - SCALE( 20704), SCALE( -76817), SCALE(-507233), SCALE(4267162), - SCALE(5073593), SCALE(-246406), SCALE(-174764), SCALE( 32480), - SCALE( 21915), SCALE( -86327), SCALE(-485757), SCALE(4362672), - SCALE(4990831), SCALE(-283146), SCALE(-162575), SCALE( 31101), - SCALE( 23157), SCALE( -96193), SCALE(-462476), SCALE(4456942), - SCALE(4906129), SCALE(-317890), SCALE(-150692), SCALE( 29732), - SCALE( 24426), SCALE(-106412), SCALE(-437356), SCALE(4549871), - SCALE(4819584), SCALE(-350658), SCALE(-139125), SCALE( 28376), - SCALE( 25721), SCALE(-116977), SCALE(-410365), SCALE(4641355), - SCALE(4731293), SCALE(-381475), SCALE(-127884), SCALE( 27038), -}; -#undef SCALE - DECLARE_ALIGNED(16, const float, ff_dca_fir_64bands)[1024] = { /* Bank 0 */ -7.1279389866041690e-8, -7.0950903150874990e-8, @@ -8178,220 +8107,11 @@ const uint32_t ff_dca_inv_dmixtable[FF_DCA_INV_DMIXTABLE_SIZE] = { 65536, }; -const float ff_dca_default_coeffs[10][6][2] = { - { { 0.707107, 0.707107 }, { 0.000000, 0.000000 }, }, // A [LFE] - { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 }, }, // A + B (dual mono) [LFE] - { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 }, }, // L + R (stereo) [LFE] - { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 }, }, // (L+R) + (L-R) (sum-difference) [LFE] - { { 1.000000, 0.000000 }, { 0.000000, 1.000000 }, { 0.000000, 0.000000 }, }, // LT + RT (left and right total) [LFE] - { { 0.501187, 0.501187 }, { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.000000, 0.000000 }, }, // C + L + R [LFE] - { { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.501187 }, { 0.000000, 0.000000 }, }, // L + R + S [LFE] - { { 0.501187, 0.501187 }, { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.501187 }, { 0.000000, 0.000000 }, }, // C + L + R + S [LFE] - { { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.000000 }, { 0.000000, 0.501187 }, { 0.000000, 0.000000 }, }, // L + R + SL + SR [LFE] - { { 0.501187, 0.501187 }, { 0.707107, 0.000000 }, { 0.000000, 0.707107 }, { 0.501187, 0.000000 }, { 0.000000, 0.501187 }, { 0.000000, 0.000000 }, }, // C + L + R + SL + SR [LFE] -}; - const int32_t ff_dca_sampling_freqs[16] = { 8000, 16000, 32000, 64000, 128000, 22050, 44100, 88200, 176400, 352800, 12000, 24000, 48000, 96000, 192000, 384000, }; -/* downmix coeffs - * - * TABLE 9 - * ______________________________________ - * Down-mix coefficients for 8-channel source - * audio (5 + 3 format) - * lt - * cen- rt lt ctr rt - * lt ter ctr center - * rt srd srd srd - * ______________________________________ - * 1 0.71 0.74 1.0 0.71 0.71 0.58 0.58 0.58 - * 2 left 1.0 0.89 0.71 0.46 0.71 0.50 - * rt 0.45 0.71 0.89 1.0 0.50 0.71 - * 3 lt 1.0 0.89 0.71 0.45 - * rt 0.45 0.71 0.89 1.0 - * srd 0.71 0.71 0.71 - * 4 lt 1.0 0.89 0.71 0.45 - * rt 0.45 0.71 0.89 1.0 - * lt srd 1.0 0.71 - * rt srd 0.71 0.71 - * 4 lt 1.0 0.5 - * ctr 0.87 1.0 0.87 - * rt 0.5 1.0 - * srd 0.71 0.71 0.71 - * 5 lt 1.0 0.5 - * ctr 0.87 1.0 0.87 - * rt 0.5 1.0 - * lt srd 1.0 0.71 - * rt srd 0.71 1.0 - * 6 lt 1.0 0.5 - * lt ctr 0.87 0.71 - * rt ctr 0.71 0.87 - * rt 0.5 1.0 - * lt srd 1.0 0.71 - * rt srd 0.71 1.0 - * 6 lt 1.0 0.5 - * ctr 0.86 1.0 0.86 - * rt 0.5 1.0 - * lt srd 1.0 - * ctr srd 1.0 - * rt srd 1.0 - * 7 lt 1.0 - * lt ctr 1.0 - * ctr 1.0 - * rt ctr 1.0 - * rt 1.0 - * lt srd 1.0 0.71 - * rt srd 0.71 1.0 - * 7 lt 1.0 0.5 - * lt ctr 0.87 0.71 - * rt ctr 0.71 0.87 - * rt 0.5 1.0 - * lt srd 1.0 - * ctr srd 1.0 - * rt srd 1.0 - * 8 lt 1.0 0.5 - * lt ctr 0.87 0.71 - * rt ctr 0.71 0.87 - * rt 0.5 1.0 - * lt 1 srd 0.87 0.35 - * lt 2 srd 0.5 0.61 - * rt 2 srd 0.61 0.50 - * rt 2 srd 0.35 0.87 - * - * Generation of Lt Rt - * - * In the case when the playback system has analog or digital surround - * multi-channel capability, a down matrix from 5, 4, or 3 channel to - * Lt Rt may be desirable. In the case when the number of decoded audio - * channels exceeds 5, 4 or 3 respectively a first stage down mix to 5, - * 4 or 3 chs should be used as described above. - * - * The down matrixing equations for 5-channel source audio to a - * two-channel Lt Rt playback system are given by: - * - * Left = left + 0.7 * center - 0.7 * (lt surround + rt surround) - * - * Right = right + 0.7 * center + 0.7 * (lt surround + rt surround) - * - * Embedded mixing to 2-channel - * - * One concern arising from the proliferation of multi-channel audio - * systems is that most home systems presently have only two channel - * playback capability. To accommodate this a fixed 2-channel down - * matrix processes is commonly used following the multi-channel - * decoding stage. However, for music only applications the image - * quality etc. of the down matrixed signal may not match that of an - * equivalent stereo recording found on CD. - * - * The concept of embedded mixing is to allow the producer to - * dynamically specify the matrixing coefficients within the audio - * frame itself. In this way the stereo down mix at the decoder may be - * better matched to a 2-channel playback environment. - * - * CHS*2, 7-bit down mix indexes (MCOEFFS) are transmitted along with - * the multi-channel audio once in every frame. The indexes are - * converted to attenuation factors using a 7 bit LUT. The 2-ch down - * mix equations are as follows, - * - * Left Ch = sum (MCOEFF[n] * Ch[n]) for n=1, CHS - * - * Right Ch = sum (MCOEFF[n + CHS] * Ch[n]) for n=1, CHS - * - * where Ch(n) represents the subband samples in the (n)th audio channel. - */ - -const uint32_t ff_dca_map_xxch_to_native[28] = { - AV_CH_FRONT_CENTER, - AV_CH_FRONT_LEFT, - AV_CH_FRONT_RIGHT, - AV_CH_SIDE_LEFT, - AV_CH_SIDE_RIGHT, - AV_CH_LOW_FREQUENCY, - AV_CH_BACK_CENTER, - AV_CH_BACK_LEFT, - AV_CH_BACK_RIGHT, - AV_CH_SIDE_LEFT, /* side surround left -- dup sur side L */ - AV_CH_SIDE_RIGHT, /* side surround right -- dup sur side R */ - AV_CH_FRONT_LEFT_OF_CENTER, - AV_CH_FRONT_RIGHT_OF_CENTER, - AV_CH_TOP_FRONT_LEFT, - AV_CH_TOP_FRONT_CENTER, - AV_CH_TOP_FRONT_RIGHT, - AV_CH_LOW_FREQUENCY, /* lfe2 -- duplicate lfe1 position */ - AV_CH_FRONT_LEFT_OF_CENTER, /* side front left -- dup front cntr L */ - AV_CH_FRONT_RIGHT_OF_CENTER,/* side front right -- dup front cntr R */ - AV_CH_TOP_CENTER, /* overhead */ - AV_CH_TOP_FRONT_LEFT, /* side high left -- dup */ - AV_CH_TOP_FRONT_RIGHT, /* side high right -- dup */ - AV_CH_TOP_BACK_CENTER, - AV_CH_TOP_BACK_LEFT, - AV_CH_TOP_BACK_RIGHT, - AV_CH_BACK_CENTER, /* rear low center -- dup */ - AV_CH_BACK_LEFT, /* rear low left -- dup */ - AV_CH_BACK_RIGHT /* read low right -- dup */ -}; - -/* -1 are reserved or unknown */ -const int ff_dca_ext_audio_descr_mask[8] = { - DCA_EXT_XCH, - -1, - DCA_EXT_X96, - DCA_EXT_XCH | DCA_EXT_X96, - -1, - -1, - DCA_EXT_XXCH, - -1, -}; - -/* Tables for mapping dts channel configurations to libavcodec multichannel api. - * Some compromises have been made for special configurations. Most configurations - * are never used so complete accuracy is not needed. - * - * L = left, R = right, C = center, S = surround, F = front, R = rear, T = total, OV = overhead. - * S -> side, when both rear and back are configured move one of them to the side channel - * OV -> center back - * All 2 channel configurations -> AV_CH_LAYOUT_STEREO - */ -const uint64_t ff_dca_core_channel_layout[16] = { - AV_CH_FRONT_CENTER, ///< 1, A - AV_CH_LAYOUT_STEREO, ///< 2, A + B (dual mono) - AV_CH_LAYOUT_STEREO, ///< 2, L + R (stereo) - AV_CH_LAYOUT_STEREO, ///< 2, (L + R) + (L - R) (sum-difference) - AV_CH_LAYOUT_STEREO, ///< 2, LT + RT (left and right total) - AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER, ///< 3, C + L + R - AV_CH_LAYOUT_STEREO | AV_CH_BACK_CENTER, ///< 3, L + R + S - AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER | AV_CH_BACK_CENTER, ///< 4, C + L + R + S - AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT, ///< 4, L + R + SL + SR - - AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER | AV_CH_SIDE_LEFT | - AV_CH_SIDE_RIGHT, ///< 5, C + L + R + SL + SR - - AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT | - AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER, ///< 6, CL + CR + L + R + SL + SR - - AV_CH_LAYOUT_STEREO | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | - AV_CH_FRONT_CENTER | AV_CH_BACK_CENTER, ///< 6, C + L + R + LR + RR + OV - - AV_CH_FRONT_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER | - AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_BACK_CENTER | - AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT, ///< 6, CF + CR + LF + RF + LR + RR - - AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_CENTER | - AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_LAYOUT_STEREO | - AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT, ///< 7, CL + C + CR + L + R + SL + SR - - AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER | - AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT | - AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT, ///< 8, CL + CR + L + R + SL1 + SL2 + SR1 + SR2 - - AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_CENTER | - AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_LAYOUT_STEREO | - AV_CH_SIDE_LEFT | AV_CH_BACK_CENTER | AV_CH_SIDE_RIGHT, ///< 8, CL + C + CR + L + R + SL + S + SR -}; - const int8_t ff_dca_lfe_index[16] = { 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3 }; @@ -8415,25 +8135,6 @@ const int8_t ff_dca_channel_reorder_lfe[16][9] = { { 4, 2, 5, 0, 1, 6, 8, 7, -1 }, }; -const int8_t ff_dca_channel_reorder_lfe_xch[16][9] = { - { 0, 2, -1, -1, -1, -1, -1, -1, -1 }, - { 0, 1, 3, -1, -1, -1, -1, -1, -1 }, - { 0, 1, 3, -1, -1, -1, -1, -1, -1 }, - { 0, 1, 3, -1, -1, -1, -1, -1, -1 }, - { 0, 1, 3, -1, -1, -1, -1, -1, -1 }, - { 2, 0, 1, 4, -1, -1, -1, -1, -1 }, - { 0, 1, 3, 4, -1, -1, -1, -1, -1 }, - { 2, 0, 1, 4, 5, -1, -1, -1, -1 }, - { 0, 1, 4, 5, 3, -1, -1, -1, -1 }, - { 2, 0, 1, 5, 6, 4, -1, -1, -1 }, - { 3, 4, 0, 1, 6, 7, 5, -1, -1 }, - { 2, 0, 1, 4, 5, 6, 7, -1, -1 }, - { 0, 6, 4, 5, 2, 3, 7, -1, -1 }, - { 4, 2, 5, 0, 1, 7, 8, 6, -1 }, - { 5, 6, 0, 1, 8, 3, 9, 4, 7 }, - { 4, 2, 5, 0, 1, 6, 9, 8, 7 }, -}; - const int8_t ff_dca_channel_reorder_nolfe[16][9] = { { 0, -1, -1, -1, -1, -1, -1, -1, -1 }, { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, @@ -8453,25 +8154,6 @@ const int8_t ff_dca_channel_reorder_nolfe[16][9] = { { 3, 2, 4, 0, 1, 5, 7, 6, -1 }, }; -const int8_t ff_dca_channel_reorder_nolfe_xch[16][9] = { - { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, - { 0, 1, 2, -1, -1, -1, -1, -1, -1 }, - { 0, 1, 2, -1, -1, -1, -1, -1, -1 }, - { 0, 1, 2, -1, -1, -1, -1, -1, -1 }, - { 0, 1, 2, -1, -1, -1, -1, -1, -1 }, - { 2, 0, 1, 3, -1, -1, -1, -1, -1 }, - { 0, 1, 2, 3, -1, -1, -1, -1, -1 }, - { 2, 0, 1, 3, 4, -1, -1, -1, -1 }, - { 0, 1, 3, 4, 2, -1, -1, -1, -1 }, - { 2, 0, 1, 4, 5, 3, -1, -1, -1 }, - { 2, 3, 0, 1, 5, 6, 4, -1, -1 }, - { 2, 0, 1, 3, 4, 5, 6, -1, -1 }, - { 0, 5, 3, 4, 1, 2, 6, -1, -1 }, - { 3, 2, 4, 0, 1, 6, 7, 5, -1 }, - { 4, 5, 0, 1, 7, 2, 8, 3, 6 }, - { 3, 2, 4, 0, 1, 5, 8, 7, 6 }, -}; - const uint16_t ff_dca_vlc_offs[63] = { 0, 512, 640, 768, 1282, 1794, 2436, 3080, 3770, 4454, 5364, 5372, 5380, 5388, 5392, 5396, 5412, 5420, 5428, 5460, 5492, 5508, diff --git a/libavcodec/dcadata.h b/libavcodec/dcadata.h index 262c37e..3d318fe 100644 --- a/libavcodec/dcadata.h +++ b/libavcodec/dcadata.h @@ -45,7 +45,6 @@ extern const float ff_dca_fir_32bands_nonperfect[512]; extern const float ff_dca_lfe_fir_64[256]; extern const float ff_dca_lfe_fir_128[256]; -extern const float ff_dca_lfe_xll_fir_64[256]; extern const float ff_dca_fir_64bands[1024]; #define FF_DCA_DMIXTABLE_SIZE 242 @@ -54,21 +53,12 @@ extern const float ff_dca_fir_64bands[1024]; extern const uint16_t ff_dca_dmixtable[FF_DCA_DMIXTABLE_SIZE]; extern const uint32_t ff_dca_inv_dmixtable[FF_DCA_INV_DMIXTABLE_SIZE]; -extern const float ff_dca_default_coeffs[10][6][2]; - -extern const uint32_t ff_dca_map_xxch_to_native[28]; -extern const int ff_dca_ext_audio_descr_mask[8]; - -extern const uint64_t ff_dca_core_channel_layout[16]; - extern const int32_t ff_dca_sampling_freqs[16]; extern const int8_t ff_dca_lfe_index[16]; extern const int8_t ff_dca_channel_reorder_lfe[16][9]; -extern const int8_t ff_dca_channel_reorder_lfe_xch[16][9]; extern const int8_t ff_dca_channel_reorder_nolfe[16][9]; -extern const int8_t ff_dca_channel_reorder_nolfe_xch[16][9]; extern const uint16_t ff_dca_vlc_offs[63]; diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c deleted file mode 100644 index 6b8d02d..0000000 diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c deleted file mode 100644 index 32b149d..0000000 diff --git a/libavcodec/dcadsp.h b/libavcodec/dcadsp.h deleted file mode 100644 index 8c8db85..0000000 diff --git a/libavcodec/dcamath.h b/libavcodec/dcamath.h deleted file mode 100644 index 06dc432..0000000 diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index 0d09fe6..69e3db3 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -44,7 +44,6 @@ OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp_init.o OBJS-$(CONFIG_ALAC_DECODER) += x86/alacdsp_init.o OBJS-$(CONFIG_APNG_DECODER) += x86/pngdsp_init.o OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp.o -OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp_init.o OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc_init.o OBJS-$(CONFIG_HEVC_DECODER) += x86/hevcdsp_init.o OBJS-$(CONFIG_JPEG2000_DECODER) += x86/jpeg2000dsp_init.o @@ -132,7 +131,6 @@ YASM-OBJS-$(CONFIG_ADPCM_G722_DECODER) += x86/g722dsp.o YASM-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp.o YASM-OBJS-$(CONFIG_ALAC_DECODER) += x86/alacdsp.o YASM-OBJS-$(CONFIG_APNG_DECODER) += x86/pngdsp.o -YASM-OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp.o YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o \ x86/dwt_yasm.o YASM-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o diff --git a/libavcodec/x86/dcadsp.asm b/libavcodec/x86/dcadsp.asm index 502b70a..bc1a48f 100644 --- a/libavcodec/x86/dcadsp.asm +++ b/libavcodec/x86/dcadsp.asm @@ -21,107 +21,8 @@ %include "libavutil/x86/x86util.asm" -SECTION_RODATA -pf_inv16: times 4 dd 0x3D800000 ; 1/16 - SECTION .text -; %1=v0/v1 %2=in1 %3=in2 -%macro FIR_LOOP 2-3 -.loop%1: -%define va m1 -%define vb m2 -%if %1 -%define OFFSET 0 -%else -%define OFFSET NUM_COEF*count -%endif -; for v0, incrementing and for v1, decrementing - mova va, [cf0q + OFFSET] - mova vb, [cf0q + OFFSET + 4*NUM_COEF] -%if %0 == 3 - mova m4, [cf0q + OFFSET + mmsize] - mova m0, [cf0q + OFFSET + 4*NUM_COEF + mmsize] -%endif - mulps va, %2 - mulps vb, %2 -%if %0 == 3 -%if cpuflag(fma3) - fmaddps va, m4, %3, va - fmaddps vb, m0, %3, vb -%else - mulps m4, %3 - mulps m0, %3 - addps va, m4 - addps vb, m0 -%endif -%endif - ; va = va1 va2 va3 va4 - ; vb = vb1 vb2 vb3 vb4 -%if %1 - SWAP va, vb -%endif - mova m4, va - unpcklps va, vb ; va3 vb3 va4 vb4 - unpckhps m4, vb ; va1 vb1 va2 vb2 - addps m4, va ; va1+3 vb1+3 va2+4 vb2+4 - movhlps vb, m4 ; va1+3 vb1+3 - addps vb, m4 ; va0..4 vb0..4 - movlps [outq + count], vb -%if %1 - sub cf0q, 8*NUM_COEF -%endif - add count, 8 - jl .loop%1 -%endmacro - -; void dca_lfe_fir(float *out, float *in, float *coefs) -%macro DCA_LFE_FIR 1 -cglobal dca_lfe_fir%1, 3,3,6-%1, out, in, cf0 -%define IN1 m3 -%define IN2 m5 -%define count inq -%define NUM_COEF 4*(2-%1) -%define NUM_OUT 32*(%1+1) - - movu IN1, [inq + 4 - 1*mmsize] - shufps IN1, IN1, q0123 -%if %1 == 0 - movu IN2, [inq + 4 - 2*mmsize] - shufps IN2, IN2, q0123 -%endif - - mov count, -4*NUM_OUT - add cf0q, 4*NUM_COEF*NUM_OUT - add outq, 4*NUM_OUT - ; compute v0 first -%if %1 == 0 - FIR_LOOP 0, IN1, IN2 -%else - FIR_LOOP 0, IN1 -%endif - shufps IN1, IN1, q0123 - mov count, -4*NUM_OUT - ; cf1 already correctly positioned - add outq, 4*NUM_OUT ; outq now at out2 - sub cf0q, 8*NUM_COEF -%if %1 == 0 - shufps IN2, IN2, q0123 - FIR_LOOP 1, IN2, IN1 -%else - FIR_LOOP 1, IN1 -%endif - RET -%endmacro - -INIT_XMM sse -DCA_LFE_FIR 0 -DCA_LFE_FIR 1 -%if HAVE_FMA3_EXTERNAL -INIT_XMM fma3 -DCA_LFE_FIR 0 -%endif - %macro SETZERO 1 %if cpuflag(sse2) && notcpuflag(avx) pxor %1, %1 diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c index 1321dda..0649ea2 100644 --- a/libavcodec/x86/dcadsp_init.c +++ b/libavcodec/x86/dcadsp_init.c @@ -21,26 +21,7 @@ #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/cpu.h" -#include "libavcodec/dcadsp.h" - -void ff_dca_lfe_fir0_sse(float *out, const float *in, const float *coefs); -void ff_dca_lfe_fir1_sse(float *out, const float *in, const float *coefs); -void ff_dca_lfe_fir0_fma3(float *out, const float *in, const float *coefs); - -av_cold void ff_dcadsp_init_x86(DCADSPContext *s) -{ - int cpu_flags = av_get_cpu_flags(); - - if (EXTERNAL_SSE(cpu_flags)) { - s->lfe_fir[0] = ff_dca_lfe_fir0_sse; - s->lfe_fir[1] = ff_dca_lfe_fir1_sse; - } - - if (EXTERNAL_FMA3(cpu_flags)) { - s->lfe_fir[0] = ff_dca_lfe_fir0_fma3; - } -} - +#include "libavcodec/synth_filter.h" #define SYNTH_FILTER_FUNC(opt) \ void ff_synth_filter_inner_##opt(float *synth_buf_ptr, float synth_buf2[32], \ -- 2.1.4 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel