32 const int16_t *
data,
int count)
36 for (
int i = 0;
i < count;
i++)
43 static const int ends[] = { 7, 27, 28, 29, 37, 73, 133, 229, 253 };
44 static const int offsets[] = { -960, -959, 0, 1024, 3132 };
58 for (
int pattern = 0; pattern < 4; pattern++) {
59 uint32_t psd_hash = 0, bap_hash = 0;
62 exp[
i] = pattern == 0 ? 0 : pattern == 1 ? 24 :
63 pattern == 2 ? (
i & 1) * 24 :
av_lfg_get(&lfg) % 25;
65 for (
int start = 0; start < 253; start++) {
67 int end = j ? ends[j - 1] : start + 1;
71 memset(psd, 0x5a,
sizeof(psd));
72 memset(band_psd, 0x5a,
sizeof(band_psd));
79 memset(bap, 0x5a,
sizeof(bap));
83 bap_hash =
av_crc(crc, bap_hash, bap,
sizeof(bap));
88 printf(
"pattern %d: psd %08"PRIx32
" bap %08"PRIx32
"\n",
89 pattern, psd_hash, bap_hash);
void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd, int16_t *band_psd)
Calculate the log power-spectral density of the input signal.
Common code between the AC-3 encoder and decoder.
#define AC3_CRITICAL_BANDS
const int16_t ff_ac3_floor_tab[8]
const uint8_t ff_ac3_bap_tab[64]
static uint8_t hash[HASH_SIZE]
#define i(width, name, range_min, range_max)
Public header for CRC hash function implementation.
__device__ int printf(const char *,...)
static __device__ float floor(float a)
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
static const int offsets[]
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
av_cold void ff_ac3dsp_init(AC3DSPContext *c)
static const uint16_t mask[17]
Utility Preprocessor macros.
#define FF_ARRAY_ELEMS(a)
void(* bit_alloc_calc_bap)(int16_t *mask, int16_t *psd, int start, int end, int snr_offset, int floor, const uint8_t *bap_tab, uint8_t *bap)
Calculate bit allocation pointers.
Context structure for the Lagged Fibonacci PRNG.
static uint32_t hash_int16(const AVCRC *crc, uint32_t hash, const int16_t *data, int count)