FFmpeg
Loading...
Searching...
No Matches
sbcdsp.h
Go to the documentation of this file.
1/*
2 * Bluetooth low-complexity, subband codec (SBC)
3 *
4 * Copyright (C) 2017 Aurelien Jacobs <aurel@gnuage.org>
5 * Copyright (C) 2008-2010 Nokia Corporation
6 * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
7 * Copyright (C) 2004-2005 Henryk Ploetz <henryk@ploetzli.ch>
8 * Copyright (C) 2005-2006 Brad Midgley <bmidgley@xmission.com>
9 *
10 * This file is part of FFmpeg.
11 *
12 * FFmpeg is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation; either
15 * version 2.1 of the License, or (at your option) any later version.
16 *
17 * FFmpeg is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with FFmpeg; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26
27/**
28 * @file
29 * SBC basic "building bricks"
30 */
31
32#ifndef AVCODEC_SBCDSP_H
33#define AVCODEC_SBCDSP_H
34
35#include <stdint.h>
36
38
39#include "sbc.h"
40
41#define SCALE_OUT_BITS 15
42#define SBC_X_BUFFER_SIZE 328
43
44typedef struct sbc_dsp_context SBCDSPContext;
45
48 /* Number of consecutive blocks handled by the encoder */
49 uint8_t increment;
51 void (*sbc_analyze_4)(const int16_t *in, int32_t *out, const int16_t *consts);
52 void (*sbc_analyze_8)(const int16_t *in, int32_t *out, const int16_t *consts);
53 /* Polyphase analysis filter for 4 subbands configuration,
54 * it handles "increment" blocks at once */
55 void (*sbc_analyze_4s)(SBCDSPContext *s,
56 const int16_t *x, int32_t *out, int out_stride);
57 /* Polyphase analysis filter for 8 subbands configuration,
58 * it handles "increment" blocks at once */
59 void (*sbc_analyze_8s)(SBCDSPContext *s,
60 const int16_t *x, int32_t *out, int out_stride);
61 /* Process input data (deinterleave, endian conversion, reordering),
62 * depending on the number of subbands and input data byte order */
63 int (*sbc_enc_process_input_4s)(int position, const uint8_t *pcm,
64 int16_t X[2][SBC_X_BUFFER_SIZE],
65 int nsamples, int nchannels);
66 int (*sbc_enc_process_input_8s)(int position, const uint8_t *pcm,
67 int16_t X[2][SBC_X_BUFFER_SIZE],
68 int nsamples, int nchannels);
69 /* Scale factors calculation */
70 void (*sbc_calc_scalefactors)(const int32_t sb_sample_f[16][2][8],
71 uint32_t scale_factor[2][8],
72 int blocks, int channels, int subbands);
73 /* Scale factors calculation with joint stereo support */
74 int (*sbc_calc_scalefactors_j)(int32_t sb_sample_f[16][2][8],
75 uint32_t scale_factor[2][8],
76 int blocks, int subbands);
77};
78
79/*
80 * Initialize pointers to the functions which are the basic "building bricks"
81 * of SBC codec. Best implementation is selected based on target CPU
82 * capabilities.
83 */
84void ff_sbcdsp_init(SBCDSPContext *s);
85
86void ff_sbcdsp_init_arm(SBCDSPContext *s);
87void ff_sbcdsp_init_x86(SBCDSPContext *s);
88
89#endif /* AVCODEC_SBCDSP_H */
static FILE * out
channels
Definition aptx.h:31
subbands
Definition aptx.h:37
int32_t
#define s(width, name)
Definition cbs_vp9.c:198
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
SBC common definitions for the encoder and decoder.
#define SBC_ALIGN
Definition sbc.h:80
void ff_sbcdsp_init(SBCDSPContext *s)
Definition sbcdsp.c:364
void ff_sbcdsp_init_arm(SBCDSPContext *s)
#define SBC_X_BUFFER_SIZE
Definition sbcdsp.h:42
void ff_sbcdsp_init_x86(SBCDSPContext *s)
Definition sbcdsp_init.c:43
void(* sbc_analyze_8)(const int16_t *in, int32_t *out, const int16_t *consts)
Definition sbcdsp.h:52
void(* sbc_calc_scalefactors)(const int32_t sb_sample_f[16][2][8], uint32_t scale_factor[2][8], int blocks, int channels, int subbands)
Definition sbcdsp.h:70
int16_t X[2][SBC_X_BUFFER_SIZE]
Definition sbcdsp.h:50
void(* sbc_analyze_8s)(SBCDSPContext *s, const int16_t *x, int32_t *out, int out_stride)
Definition sbcdsp.h:59
uint8_t increment
Definition sbcdsp.h:49
int(* sbc_enc_process_input_4s)(int position, const uint8_t *pcm, int16_t X[2][SBC_X_BUFFER_SIZE], int nsamples, int nchannels)
Definition sbcdsp.h:63
int(* sbc_enc_process_input_8s)(int position, const uint8_t *pcm, int16_t X[2][SBC_X_BUFFER_SIZE], int nsamples, int nchannels)
Definition sbcdsp.h:66
int(* sbc_calc_scalefactors_j)(int32_t sb_sample_f[16][2][8], uint32_t scale_factor[2][8], int blocks, int subbands)
Definition sbcdsp.h:74
void(* sbc_analyze_4s)(SBCDSPContext *s, const int16_t *x, int32_t *out, int out_stride)
Definition sbcdsp.h:55
void(* sbc_analyze_4)(const int16_t *in, int32_t *out, const int16_t *consts)
Definition sbcdsp.h:51