FFmpeg
dstdec.c
Go to the documentation of this file.
1 /*
2  * Direct Stream Transfer (DST) decoder
3  * Copyright (c) 2014 Peter Ross <pross@xvid.org>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * @file
24  * Direct Stream Transfer (DST) decoder
25  * ISO/IEC 14496-3 Part 3 Subpart 10: Technical description of lossless coding of oversampled audio
26  */
27 
28 #include "libavutil/intreadwrite.h"
29 #include "libavutil/mem_internal.h"
30 #include "libavutil/reverse.h"
31 #include "codec_internal.h"
32 #include "internal.h"
33 #include "get_bits.h"
34 #include "avcodec.h"
35 #include "golomb.h"
36 #include "mathops.h"
37 #include "dsd.h"
38 
39 #define DST_MAX_CHANNELS 6
40 #define DST_MAX_ELEMENTS (2 * DST_MAX_CHANNELS)
41 
42 #define DSD_FS44(sample_rate) (sample_rate * 8LL / 44100)
43 
44 #define DST_SAMPLES_PER_FRAME(sample_rate) (588 * DSD_FS44(sample_rate))
45 
46 static const int8_t fsets_code_pred_coeff[3][3] = {
47  { -8 },
48  { -16, 8 },
49  { -9, -5, 6 },
50 };
51 
52 static const int8_t probs_code_pred_coeff[3][3] = {
53  { -8 },
54  { -16, 8 },
55  { -24, 24, -8 },
56 };
57 
58 typedef struct ArithCoder {
59  unsigned int a;
60  unsigned int c;
61 } ArithCoder;
62 
63 typedef struct Table {
64  unsigned int elements;
65  unsigned int length[DST_MAX_ELEMENTS];
67 } Table;
68 
69 typedef struct DSTContext {
70  AVClass *class;
71 
76  DECLARE_ALIGNED(16, int16_t, filter)[DST_MAX_ELEMENTS][16][256];
78 } DSTContext;
79 
81 {
82  DSTContext *s = avctx->priv_data;
83  int i;
84 
85  if (avctx->ch_layout.nb_channels > DST_MAX_CHANNELS) {
86  avpriv_request_sample(avctx, "Channel count %d", avctx->ch_layout.nb_channels);
87  return AVERROR_PATCHWELCOME;
88  }
89 
90  // the sample rate is only allowed to be 64,128,256 * 44100 by ISO/IEC 14496-3:2005(E)
91  // We are a bit more tolerant here, but this check is needed to bound the size and duration
92  if (avctx->sample_rate > 512 * 44100)
93  return AVERROR_INVALIDDATA;
94 
95 
96  if (DST_SAMPLES_PER_FRAME(avctx->sample_rate) & 7) {
97  return AVERROR_PATCHWELCOME;
98  }
99 
100  avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
101 
102  for (i = 0; i < avctx->ch_layout.nb_channels; i++)
103  memset(s->dsdctx[i].buf, 0x69, sizeof(s->dsdctx[i].buf));
104 
106 
107  return 0;
108 }
109 
110 static int read_map(GetBitContext *gb, Table *t, unsigned int map[DST_MAX_CHANNELS], int channels)
111 {
112  int ch;
113  t->elements = 1;
114  map[0] = 0;
115  if (!get_bits1(gb)) {
116  for (ch = 1; ch < channels; ch++) {
117  int bits = av_log2(t->elements) + 1;
118  map[ch] = get_bits(gb, bits);
119  if (map[ch] == t->elements) {
120  t->elements++;
121  if (t->elements >= DST_MAX_ELEMENTS)
122  return AVERROR_INVALIDDATA;
123  } else if (map[ch] > t->elements) {
124  return AVERROR_INVALIDDATA;
125  }
126  }
127  } else {
128  memset(map, 0, sizeof(*map) * DST_MAX_CHANNELS);
129  }
130  return 0;
131 }
132 
133 static av_always_inline int get_sr_golomb_dst(GetBitContext *gb, unsigned int k)
134 {
135  int v = get_ur_golomb_jpegls(gb, k, get_bits_left(gb), 0);
136  if (v && get_bits1(gb))
137  v = -v;
138  return v;
139 }
140 
141 static void read_uncoded_coeff(GetBitContext *gb, int *dst, unsigned int elements,
142  int coeff_bits, int is_signed, int offset)
143 {
144  int i;
145 
146  for (i = 0; i < elements; i++) {
147  dst[i] = (is_signed ? get_sbits(gb, coeff_bits) : get_bits(gb, coeff_bits)) + offset;
148  }
149 }
150 
151 static int read_table(GetBitContext *gb, Table *t, const int8_t code_pred_coeff[3][3],
152  int length_bits, int coeff_bits, int is_signed, int offset)
153 {
154  unsigned int i, j, k;
155  for (i = 0; i < t->elements; i++) {
156  t->length[i] = get_bits(gb, length_bits) + 1;
157  if (!get_bits1(gb)) {
158  read_uncoded_coeff(gb, t->coeff[i], t->length[i], coeff_bits, is_signed, offset);
159  } else {
160  int method = get_bits(gb, 2), lsb_size;
161  if (method == 3)
162  return AVERROR_INVALIDDATA;
163 
164  read_uncoded_coeff(gb, t->coeff[i], method + 1, coeff_bits, is_signed, offset);
165 
166  lsb_size = get_bits(gb, 3);
167  for (j = method + 1; j < t->length[i]; j++) {
168  int c, x = 0;
169  for (k = 0; k < method + 1; k++)
170  x += code_pred_coeff[method][k] * (unsigned)t->coeff[i][j - k - 1];
171  c = get_sr_golomb_dst(gb, lsb_size);
172  if (x >= 0)
173  c -= (x + 4) / 8;
174  else
175  c += (-x + 3) / 8;
176  if (!is_signed) {
177  if (c < offset || c >= offset + (1<<coeff_bits))
178  return AVERROR_INVALIDDATA;
179  }
180  t->coeff[i][j] = c;
181  }
182  }
183  }
184  return 0;
185 }
186 
187 static void ac_init(ArithCoder *ac, GetBitContext *gb)
188 {
189  ac->a = 4095;
190  ac->c = get_bits(gb, 12);
191 }
192 
193 static av_always_inline void ac_get(ArithCoder *ac, GetBitContext *gb, int p, int *e)
194 {
195  unsigned int k = (ac->a >> 8) | ((ac->a >> 7) & 1);
196  unsigned int q = k * p;
197  unsigned int a_q = ac->a - q;
198 
199  *e = ac->c < a_q;
200  if (*e) {
201  ac->a = a_q;
202  } else {
203  ac->a = q;
204  ac->c -= a_q;
205  }
206 
207  if (ac->a < 2048) {
208  int n = 11 - av_log2(ac->a);
209  ac->a <<= n;
210  ac->c = (ac->c << n) | get_bits(gb, n);
211  }
212 }
213 
214 static uint8_t prob_dst_x_bit(int c)
215 {
216  return (ff_reverse[c & 127] >> 1) + 1;
217 }
218 
219 static void build_filter(int16_t table[DST_MAX_ELEMENTS][16][256], const Table *fsets)
220 {
221  int i, j, k, l;
222 
223  for (i = 0; i < fsets->elements; i++) {
224  int length = fsets->length[i];
225 
226  for (j = 0; j < 16; j++) {
227  int total = av_clip(length - j * 8, 0, 8);
228 
229  for (k = 0; k < 256; k++) {
230  int v = 0;
231 
232  for (l = 0; l < total; l++)
233  v += (((k >> l) & 1) * 2 - 1) * fsets->coeff[i][j * 8 + l];
234  table[i][j][k] = v;
235  }
236  }
237  }
238 }
239 
241  int *got_frame_ptr, AVPacket *avpkt)
242 {
243  unsigned samples_per_frame = DST_SAMPLES_PER_FRAME(avctx->sample_rate);
244  unsigned map_ch_to_felem[DST_MAX_CHANNELS];
245  unsigned map_ch_to_pelem[DST_MAX_CHANNELS];
246  unsigned i, ch, same_map, dst_x_bit;
247  unsigned half_prob[DST_MAX_CHANNELS];
248  const int channels = avctx->ch_layout.nb_channels;
249  DSTContext *s = avctx->priv_data;
250  GetBitContext *gb = &s->gb;
251  ArithCoder *ac = &s->ac;
252  uint8_t *dsd;
253  float *pcm;
254  int ret;
255 
256  if (avpkt->size <= 1)
257  return AVERROR_INVALIDDATA;
258 
259  frame->nb_samples = samples_per_frame / 8;
260  if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
261  return ret;
262  dsd = frame->data[0];
263  pcm = (float *)frame->data[0];
264 
265  if ((ret = init_get_bits8(gb, avpkt->data, avpkt->size)) < 0)
266  return ret;
267 
268  if (!get_bits1(gb)) {
269  skip_bits1(gb);
270  if (get_bits(gb, 6))
271  return AVERROR_INVALIDDATA;
272  memcpy(frame->data[0], avpkt->data + 1, FFMIN(avpkt->size - 1, frame->nb_samples * channels));
273  goto dsd;
274  }
275 
276  /* Segmentation (10.4, 10.5, 10.6) */
277 
278  if (!get_bits1(gb)) {
279  avpriv_request_sample(avctx, "Not Same Segmentation");
280  return AVERROR_PATCHWELCOME;
281  }
282 
283  if (!get_bits1(gb)) {
284  avpriv_request_sample(avctx, "Not Same Segmentation For All Channels");
285  return AVERROR_PATCHWELCOME;
286  }
287 
288  if (!get_bits1(gb)) {
289  avpriv_request_sample(avctx, "Not End Of Channel Segmentation");
290  return AVERROR_PATCHWELCOME;
291  }
292 
293  /* Mapping (10.7, 10.8, 10.9) */
294 
295  same_map = get_bits1(gb);
296 
297  if ((ret = read_map(gb, &s->fsets, map_ch_to_felem, channels)) < 0)
298  return ret;
299 
300  if (same_map) {
301  s->probs.elements = s->fsets.elements;
302  memcpy(map_ch_to_pelem, map_ch_to_felem, sizeof(map_ch_to_felem));
303  } else {
304  avpriv_request_sample(avctx, "Not Same Mapping");
305  if ((ret = read_map(gb, &s->probs, map_ch_to_pelem, channels)) < 0)
306  return ret;
307  }
308 
309  /* Half Probability (10.10) */
310 
311  for (ch = 0; ch < channels; ch++)
312  half_prob[ch] = get_bits1(gb);
313 
314  /* Filter Coef Sets (10.12) */
315 
316  ret = read_table(gb, &s->fsets, fsets_code_pred_coeff, 7, 9, 1, 0);
317  if (ret < 0)
318  return ret;
319 
320  /* Probability Tables (10.13) */
321 
322  ret = read_table(gb, &s->probs, probs_code_pred_coeff, 6, 7, 0, 1);
323  if (ret < 0)
324  return ret;
325 
326  /* Arithmetic Coded Data (10.11) */
327 
328  if (get_bits1(gb))
329  return AVERROR_INVALIDDATA;
330  ac_init(ac, gb);
331 
332  build_filter(s->filter, &s->fsets);
333 
334  memset(s->status, 0xAA, sizeof(s->status));
335  memset(dsd, 0, frame->nb_samples * 4 * channels);
336 
337  ac_get(ac, gb, prob_dst_x_bit(s->fsets.coeff[0][0]), &dst_x_bit);
338 
339  for (i = 0; i < samples_per_frame; i++) {
340  for (ch = 0; ch < channels; ch++) {
341  const unsigned felem = map_ch_to_felem[ch];
342  int16_t (*filter)[256] = s->filter[felem];
343  uint8_t *status = s->status[ch];
344  int prob, residual, v;
345 
346 #define F(x) filter[(x)][status[(x)]]
347  const int16_t predict = F( 0) + F( 1) + F( 2) + F( 3) +
348  F( 4) + F( 5) + F( 6) + F( 7) +
349  F( 8) + F( 9) + F(10) + F(11) +
350  F(12) + F(13) + F(14) + F(15);
351 #undef F
352 
353  if (!half_prob[ch] || i >= s->fsets.length[felem]) {
354  unsigned pelem = map_ch_to_pelem[ch];
355  unsigned index = FFABS(predict) >> 3;
356  prob = s->probs.coeff[pelem][FFMIN(index, s->probs.length[pelem] - 1)];
357  } else {
358  prob = 128;
359  }
360 
361  ac_get(ac, gb, prob, &residual);
362  v = ((predict >> 15) ^ residual) & 1;
363  dsd[((i >> 3) * channels + ch) << 2] |= v << (7 - (i & 0x7 ));
364 
365  AV_WL64A(status + 8, (AV_RL64A(status + 8) << 1) | ((AV_RL64A(status) >> 63) & 1));
366  AV_WL64A(status, (AV_RL64A(status) << 1) | v);
367  }
368  }
369 
370 dsd:
371  for (i = 0; i < channels; i++) {
372  ff_dsd2pcm_translate(&s->dsdctx[i], frame->nb_samples, 0,
373  frame->data[0] + i * 4,
374  channels * 4, pcm + i, channels);
375  }
376 
377  *got_frame_ptr = 1;
378 
379  return avpkt->size;
380 }
381 
383  .p.name = "dst",
384  .p.long_name = NULL_IF_CONFIG_SMALL("DST (Digital Stream Transfer)"),
385  .p.type = AVMEDIA_TYPE_AUDIO,
386  .p.id = AV_CODEC_ID_DST,
387  .priv_data_size = sizeof(DSTContext),
388  .init = decode_init,
390  .p.capabilities = AV_CODEC_CAP_DR1,
391  .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT,
393  .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
394 };
ac_get
static av_always_inline void ac_get(ArithCoder *ac, GetBitContext *gb, int p, int *e)
Definition: dstdec.c:193
status
they must not be accessed directly The fifo field contains the frames that are queued in the input for processing by the filter The status_in and status_out fields contains the queued status(EOF or error) of the link
av_clip
#define av_clip
Definition: common.h:95
get_bits_left
static int get_bits_left(GetBitContext *gb)
Definition: get_bits.h:850
DSTContext::status
uint8_t status[DST_MAX_CHANNELS][16]
Definition: dstdec.c:75
mem_internal.h
DSTContext::ac
ArithCoder ac
Definition: dstdec.c:73
elements
static const ElemCat * elements[ELEMENT_COUNT]
Definition: signature.h:566
AVCodecContext::sample_rate
int sample_rate
samples per second
Definition: avcodec.h:998
DSTContext::fsets
Table fsets
Definition: dstdec.c:74
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:325
internal.h
AVPacket::data
uint8_t * data
Definition: packet.h:374
ff_reverse
const uint8_t ff_reverse[256]
Definition: reverse.c:23
table
static const uint16_t table[]
Definition: prosumer.c:206
read_table
static int read_table(GetBitContext *gb, Table *t, const int8_t code_pred_coeff[3][3], int length_bits, int coeff_bits, int is_signed, int offset)
Definition: dstdec.c:151
FFCodec
Definition: codec_internal.h:112
F
#define F(x)
reverse.h
filter
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
Definition: filter_design.txt:228
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:300
dsd.h
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: dstdec.c:240
init
static int init
Definition: av_tx.c:47
golomb.h
exp golomb vlc stuff
get_bits
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:380
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:116
AVCodecContext::ch_layout
AVChannelLayout ch_layout
Audio channel layout.
Definition: avcodec.h:2057
ac_init
static void ac_init(ArithCoder *ac, GetBitContext *gb)
Definition: dstdec.c:187
GetBitContext
Definition: get_bits.h:62
read_map
static int read_map(GetBitContext *gb, Table *t, unsigned int map[DST_MAX_CHANNELS], int channels)
Definition: dstdec.c:110
get_ur_golomb_jpegls
static int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int esc_len)
read unsigned golomb rice code (jpegls).
Definition: golomb.h:428
av_cold
#define av_cold
Definition: attributes.h:90
init_get_bits8
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:678
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:254
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:256
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: dstdec.c:80
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
bits
uint8_t bits
Definition: vp3data.h:141
get_sbits
static int get_sbits(GetBitContext *s, int n)
Definition: get_bits.h:360
channels
channels
Definition: aptx.h:32
get_bits.h
ArithCoder
Definition: dstdec.c:58
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:64
if
if(ret)
Definition: filter_design.txt:179
AV_WL64A
#define AV_WL64A(p, v)
Definition: intreadwrite.h:557
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
AV_CODEC_ID_DST
@ AV_CODEC_ID_DST
Definition: codec_id.h:506
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
DSTContext::gb
GetBitContext gb
Definition: dstdec.c:72
get_bits1
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:499
mathops.h
DSTContext::filter
int16_t filter[DST_MAX_ELEMENTS][16][256]
Definition: dstdec.c:76
fsets_code_pred_coeff
static const int8_t fsets_code_pred_coeff[3][3]
Definition: dstdec.c:46
index
int index
Definition: gxfenc.c:89
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
ff_init_dsd_data
av_cold void ff_init_dsd_data(void)
Definition: dsd.c:89
ff_get_buffer
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: decode.c:1403
ArithCoder::c
unsigned int c
Definition: dstdec.c:60
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AVPacket::size
int size
Definition: packet.h:375
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
codec_internal.h
AVCodecContext::sample_fmt
enum AVSampleFormat sample_fmt
audio sample format
Definition: avcodec.h:1014
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
probs_code_pred_coeff
static const int8_t probs_code_pred_coeff[3][3]
Definition: dstdec.c:52
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
skip_bits1
static void skip_bits1(GetBitContext *s)
Definition: get_bits.h:539
DSTContext::dsdctx
DSDContext dsdctx[DST_MAX_CHANNELS]
Definition: dstdec.c:77
DECLARE_ALIGNED
#define DECLARE_ALIGNED(n, t, v)
Definition: mem.h:116
prob_dst_x_bit
static uint8_t prob_dst_x_bit(int c)
Definition: dstdec.c:214
DSTContext::probs
Table probs
Definition: dstdec.c:74
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:271
get_sr_golomb_dst
static av_always_inline int get_sr_golomb_dst(GetBitContext *gb, unsigned int k)
Definition: dstdec.c:133
predict
static av_always_inline void predict(PredictorState *ps, float *coef, int output_enable)
Definition: aacdec.c:178
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
av_always_inline
#define av_always_inline
Definition: attributes.h:49
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: codec_internal.h:31
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:203
DSDContext
Per-channel buffer.
Definition: dsd.h:41
read_uncoded_coeff
static void read_uncoded_coeff(GetBitContext *gb, int *dst, unsigned int elements, int coeff_bits, int is_signed, int offset)
Definition: dstdec.c:141
DST_MAX_CHANNELS
#define DST_MAX_CHANNELS
Definition: dstdec.c:39
avcodec.h
DSTContext
Definition: dstdec.c:69
ff_dsd2pcm_translate
void ff_dsd2pcm_translate(DSDContext *s, size_t samples, int lsbf, const uint8_t *src, ptrdiff_t src_stride, float *dst, ptrdiff_t dst_stride)
Definition: dsd.c:95
ret
ret
Definition: filter_design.txt:187
frame
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
Definition: filter_design.txt:264
prob
#define prob(name, subs,...)
Definition: cbs_vp9.c:372
build_filter
static void build_filter(int16_t table[DST_MAX_ELEMENTS][16][256], const Table *fsets)
Definition: dstdec.c:219
Table::length
unsigned int length[DST_MAX_ELEMENTS]
Definition: dstdec.c:65
AVCodecContext
main external API structure.
Definition: avcodec.h:389
AV_RL64A
#define AV_RL64A(p)
Definition: intreadwrite.h:554
avpriv_request_sample
#define avpriv_request_sample(...)
Definition: tableprint_vlc.h:36
map
const VDPAUPixFmtMap * map
Definition: hwcontext_vdpau.c:71
AVPacket
This structure stores compressed data.
Definition: packet.h:351
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:416
ff_dst_decoder
const FFCodec ff_dst_decoder
Definition: dstdec.c:382
ArithCoder::a
unsigned int a
Definition: dstdec.c:59
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
Table::coeff
int coeff[DST_MAX_ELEMENTS][128]
Definition: dstdec.c:66
Table
Definition: dstdec.c:63
DST_MAX_ELEMENTS
#define DST_MAX_ELEMENTS
Definition: dstdec.c:40
av_log2
int av_log2(unsigned v)
Definition: intmath.c:26
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:60
DST_SAMPLES_PER_FRAME
#define DST_SAMPLES_PER_FRAME(sample_rate)
Definition: dstdec.c:44
Table::elements
unsigned int elements
Definition: dstdec.c:64