History

Merge remote-tracking branch 'qatar/master'

* qatar/master: w32threads: Make pthread_cond_wait follow POSIX cosmetics: Consistently place static, inline and av_cold attributes/keywords. sbrdsp: Use standard multiple inclusion guards. pcm: K&R formatting cosmetics rawdec: Support fourccs YV16 and YV24 rtmp: implement bandwidth notification rtmp: update supported audio codecs value Conflicts: libavcodec/pcm.c

Michael Niedermayer committed 14 years ago

Commit 4480edc2 parents 6cecb89 91dffb418 files · +176 −147Browse files

Unified · Split

18 files
  1. libavcodec/aacdec.c +1 −1
  2. libavcodec/arm/dcadsp_init_arm.c +1 −1
  3. libavcodec/arm/dsputil_init_armv5te.c +1 −1
  4. libavcodec/arm/dsputil_init_armv6.c +1 −1
  5. libavcodec/ffv1.c +2 −2
  6. libavcodec/fmtconvert.h +1 −1
  7. libavcodec/h264.c +3 −3
  8. libavcodec/ivi_common.c +3 −3
  9. libavcodec/mpegaudiodsp_template.c +1 −1
  10. libavcodec/pcm.c +131 −122
  11. libavcodec/sbrdsp.h +3 −3
  12. libavcodec/tiffenc.c +1 −1
  13. libavcodec/wma_common.c +1 −1
  14. libavcodec/wma_common.h +1 −1
  15. libavcodec/wmaprodec.c +1 −1
  16. libavdevice/fbdev.c +2 −2
  17. libavformat/rtmpproto.c +21 −1
  18. libavutil/lfg.c +1 −1
libavcodec/aacdec.c+1−1
@@ -2790,7 +2790,7 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out, · 2789 unmodified lines
27902790 return muxlength;
27912791 }
27922792
2793−av_cold static int latm_decode_init(AVCodecContext *avctx)
2793+static av_cold int latm_decode_init(AVCodecContext *avctx)
27942794 {
27952795 struct LATMContext *latmctx = avctx->priv_data;
27962796 int ret = aac_decode_init(avctx);
libavcodec/arm/dcadsp_init_arm.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 void ff_dca_lfe_fir_neon(float *out, const float *in, const float *coefs,
2626 int decifactor, float scale);
2727
28−void av_cold ff_dcadsp_init_arm(DCADSPContext *s)
28+av_cold void ff_dcadsp_init_arm(DCADSPContext *s)
2929 {
3030 if (HAVE_NEON)
3131 s->lfe_fir = ff_dca_lfe_fir_neon;
libavcodec/arm/dsputil_init_armv5te.c+1−1
@@ -27,7 +27,7 @@ void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, DCTELEM *data); · 26 unmodified lines
2727
2828 void ff_prefetch_arm(void *mem, int stride, int h);
2929
30−void av_cold ff_dsputil_init_armv5te(DSPContext* c, AVCodecContext *avctx)
30+av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx)
3131 {
3232 if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
3333 (avctx->idct_algo == FF_IDCT_AUTO ||
libavcodec/arm/dsputil_init_armv6.c+1−1
@@ -70,7 +70,7 @@ int ff_sse16_armv6(void *s, uint8_t *blk1, uint8_t *blk2, · 69 unmodified lines
7070 int ff_pix_norm1_armv6(uint8_t *pix, int line_size);
7171 int ff_pix_sum_armv6(uint8_t *pix, int line_size);
7272
73−void av_cold ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx)
73+av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx)
7474 {
7575 const int high_bit_depth = avctx->bits_per_raw_sample > 8;
7676
libavcodec/ffv1.c+2−2
@@ -328,7 +328,7 @@ do{\ · 327 unmodified lines
328328 #undef put_rac
329329 }
330330
331−static void av_noinline put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed){
331+static av_noinline void put_symbol(RangeCoder *c, uint8_t *state, int v, int is_signed){
332332 put_symbol_inline(c, state, v, is_signed, NULL, NULL);
333333 }
334334
@@ -352,7 +352,7 @@ static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, in · 17 unmodified lines
352352 }
353353 }
354354
355−static int av_noinline get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
355+static av_noinline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
356356 return get_symbol_inline(c, state, is_signed);
357357 }
358358
libavcodec/fmtconvert.h+1−1
@@ -87,7 +87,7 @@ typedef struct FmtConvertContext { · 86 unmodified lines
8787 void ff_float_interleave_c(float *dst, const float **src, unsigned int len,
8888 int channels);
8989
90−void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx);
90+av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx);
9191
9292 void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx);
9393 void ff_fmt_convert_init_altivec(FmtConvertContext *c, AVCodecContext *avctx);
libavcodec/h264.c+3−3
@@ -2408,17 +2408,17 @@ hl_decode_mb_simple(1, 16) · 2407 unmodified lines
24082408 /**
24092409 * Process a macroblock; this handles edge cases, such as interlacing.
24102410 */
2411−static void av_noinline hl_decode_mb_complex(H264Context *h)
2411+static av_noinline void hl_decode_mb_complex(H264Context *h)
24122412 {
24132413 hl_decode_mb_internal(h, 0, h->pixel_shift);
24142414 }
24152415
2416−static void av_noinline hl_decode_mb_444_complex(H264Context *h)
2416+static av_noinline void hl_decode_mb_444_complex(H264Context *h)
24172417 {
24182418 hl_decode_mb_444_internal(h, 0, h->pixel_shift);
24192419 }
24202420
2421−static void av_noinline hl_decode_mb_444_simple(H264Context *h)
2421+static av_noinline void hl_decode_mb_444_simple(H264Context *h)
24222422 {
24232423 hl_decode_mb_444_internal(h, 1, 0);
24242424 }
libavcodec/ivi_common.c+3−3
@@ -164,7 +164,7 @@ void ff_ivi_huff_desc_copy(IVIHuffDesc *dst, const IVIHuffDesc *src) · 163 unmodified lines
164164 memcpy(dst->xbits, src->xbits, src->num_rows);
165165 }
166166
167−int av_cold ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg)
167+av_cold int ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg)
168168 {
169169 int p, b;
170170 uint32_t b_width, b_height, align_fac, width_aligned, height_aligned, buf_size;
@@ -227,7 +227,7 @@ int av_cold ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg) · 56 unmodified lines
227227 return 0;
228228 }
229229
230−void av_cold ff_ivi_free_buffers(IVIPlaneDesc *planes)
230+av_cold void ff_ivi_free_buffers(IVIPlaneDesc *planes)
231231 {
232232 int p, b, t;
233233
@@ -247,7 +247,7 @@ void av_cold ff_ivi_free_buffers(IVIPlaneDesc *planes) · 13 unmodified lines
247247 }
248248 }
249249
250−int av_cold ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_height)
250+av_cold int ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_height)
251251 {
252252 int p, b, x, y, x_tiles, y_tiles, t_width, t_height;
253253 IVIBandDesc *band;
libavcodec/mpegaudiodsp_template.c+1−1
@@ -192,7 +192,7 @@ void RENAME(ff_mpa_synth_filter)(MPADSPContext *s, MPA_INT *synth_buf_ptr, · 191 unmodified lines
192192 *synth_buf_offset = offset;
193193 }
194194
195−void av_cold RENAME(ff_mpa_synth_init)(MPA_INT *window)
195+av_cold void RENAME(ff_mpa_synth_init)(MPA_INT *window)
196196 {
197197 int i, j;
198198
libavcodec/pcm.c+131−122
@@ -24,8 +24,8 @@ · 23 unmodified lines
2424 * PCM codecs
2525 */
2626
27−#include "avcodec.h"
2827 #include "libavutil/common.h" /* for av_reverse */
28+#include "avcodec.h"
2929 #include "bytestream.h"
3030 #include "internal.h"
3131 #include "pcm_tablegen.h"
@@ -35,7 +35,7 @@ · 3 unmodified lines
3535 static av_cold int pcm_encode_init(AVCodecContext *avctx)
3636 {
3737 avctx->frame_size = 0;
38− switch(avctx->codec->id) {
38+ switch (avctx->codec->id) {
3939 case CODEC_ID_PCM_ALAW:
4040 pcm_alaw_tableinit();
4141 break;
@@ -47,8 +47,8 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx) · 5 unmodified lines
4747 }
4848
4949 avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
50− avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
51− avctx->coded_frame= avcodec_alloc_frame();
50+ avctx->block_align = avctx->channels * avctx->bits_per_coded_sample / 8;
51+ avctx->coded_frame = avcodec_alloc_frame();
5252 if (!avctx->coded_frame)
5353 return AVERROR(ENOMEM);
5454
@@ -64,19 +64,19 @@ static av_cold int pcm_encode_close(AVCodecContext *avctx) · 9 unmodified lines
6464
6565 /**
6666 * Write PCM samples macro
67− * @param type Datatype of native machine format
67+ * @param type Datatype of native machine format
6868 * @param endian bytestream_put_xxx() suffix
69− * @param src Source pointer (variable name)
70− * @param dst Destination pointer (variable name)
71− * @param n Total number of samples (variable name)
72− * @param shift Bitshift (bits)
69+ * @param src Source pointer (variable name)
70+ * @param dst Destination pointer (variable name)
71+ * @param n Total number of samples (variable name)
72+ * @param shift Bitshift (bits)
7373 * @param offset Sample value offset
7474 */
75−#define ENCODE(type, endian, src, dst, n, shift, offset) \
76− samples_##type = (const type*) src; \
77− for(;n>0;n--) { \
78− register type v = (*samples_##type++ >> shift) + offset; \
79− bytestream_put_##endian(&dst, v); \
75+#define ENCODE(type, endian, src, dst, n, shift, offset) \
76+ samples_ ## type = (const type *) src; \
77+ for (; n > 0; n--) { \
78+ register type v = (*samples_ ## type++ >> shift) + offset; \
79+ bytestream_put_ ## endian(&dst, v); \
8080 }
8181
8282 static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
@@ -92,7 +92,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 9 unmodified lines
9292 const uint16_t *samples_uint16_t;
9393 const uint32_t *samples_uint32_t;
9494
95− sample_size = av_get_bits_per_sample(avctx->codec->id)/8;
95+ sample_size = av_get_bits_per_sample(avctx->codec->id) / 8;
9696 n = frame->nb_samples * avctx->channels;
9797 samples = (const short *)frame->data[0];
9898
@@ -100,7 +100,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 1 unmodified line
100100 return ret;
101101 dst = avpkt->data;
102102
103− switch(avctx->codec->id) {
103+ switch (avctx->codec->id) {
104104 case CODEC_ID_PCM_U32LE:
105105 ENCODE(uint32_t, le32, samples, dst, n, 0, 0x80000000)
106106 break;
@@ -120,7 +120,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 13 unmodified lines
120120 ENCODE(uint32_t, be24, samples, dst, n, 8, 0x800000)
121121 break;
122122 case CODEC_ID_PCM_S24DAUD:
123− for(;n>0;n--) {
123+ for (; n > 0; n--) {
124124 uint32_t tmp = av_reverse[(*samples >> 8) & 0xff] +
125125 (av_reverse[*samples & 0xff] << 8);
126126 tmp <<= 4; // sync flags would go here
@@ -136,8 +136,8 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 9 unmodified lines
136136 break;
137137 case CODEC_ID_PCM_S8:
138138 srcu8 = frame->data[0];
139− for(;n>0;n--) {
140− v = *srcu8++;
139+ for (; n > 0; n--) {
140+ v = *srcu8++;
141141 *dst++ = v - 128;
142142 }
143143 break;
@@ -173,18 +173,18 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 29 unmodified lines
173173 case CODEC_ID_PCM_S16LE:
174174 #endif /* HAVE_BIGENDIAN */
175175 case CODEC_ID_PCM_U8:
176− memcpy(dst, samples, n*sample_size);
177− dst += n*sample_size;
176+ memcpy(dst, samples, n * sample_size);
177+ dst += n * sample_size;
178178 break;
179179 case CODEC_ID_PCM_ALAW:
180− for(;n>0;n--) {
181− v = *samples++;
180+ for (; n > 0; n--) {
181+ v = *samples++;
182182 *dst++ = linear_to_alaw[(v + 32768) >> 2];
183183 }
184184 break;
185185 case CODEC_ID_PCM_MULAW:
186− for(;n>0;n--) {
187− v = *samples++;
186+ for (; n > 0; n--) {
187+ v = *samples++;
188188 *dst++ = linear_to_ulaw[(v + 32768) >> 2];
189189 }
190190 break;
@@ -198,10 +198,10 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 7 unmodified lines
198198
199199 typedef struct PCMDecode {
200200 AVFrame frame;
201− short table[256];
201+ short table[256];
202202 } PCMDecode;
203203
204−static av_cold int pcm_decode_init(AVCodecContext * avctx)
204+static av_cold int pcm_decode_init(AVCodecContext *avctx)
205205 {
206206 PCMDecode *s = avctx->priv_data;
207207 int i;
@@ -211,13 +211,13 @@ static av_cold int pcm_decode_init(AVCodecContext * avctx) · 3 unmodified lines
211211 return AVERROR(EINVAL);
212212 }
213213
214− switch(avctx->codec->id) {
214+ switch (avctx->codec->id) {
215215 case CODEC_ID_PCM_ALAW:
216− for(i=0;i<256;i++)
216+ for (i = 0; i < 256; i++)
217217 s->table[i] = alaw2linear(i);
218218 break;
219219 case CODEC_ID_PCM_MULAW:
220− for(i=0;i<256;i++)
220+ for (i = 0; i < 256; i++)
221221 s->table[i] = ulaw2linear(i);
222222 break;
223223 default:
@@ -237,32 +237,32 @@ static av_cold int pcm_decode_init(AVCodecContext * avctx) · 13 unmodified lines
237237
238238 /**
239239 * Read PCM samples macro
240− * @param size Data size of native machine format
240+ * @param size Data size of native machine format
241241 * @param endian bytestream_get_xxx() endian suffix
242− * @param src Source pointer (variable name)
243− * @param dst Destination pointer (variable name)
244− * @param n Total number of samples (variable name)
245− * @param shift Bitshift (bits)
242+ * @param src Source pointer (variable name)
243+ * @param dst Destination pointer (variable name)
244+ * @param n Total number of samples (variable name)
245+ * @param shift Bitshift (bits)
246246 * @param offset Sample value offset
247247 */
248−#define DECODE(size, endian, src, dst, n, shift, offset) \
249− for(;n>0;n--) { \
250− uint##size##_t v = bytestream_get_##endian(&src); \
251− AV_WN##size##A(dst, (v - offset) << shift); \
252− dst += size / 8; \
248+#define DECODE(size, endian, src, dst, n, shift, offset) \
249+ for (; n > 0; n--) { \
250+ uint ## size ## _t v = bytestream_get_ ## endian(&src); \
251+ AV_WN ## size ## A(dst, (v - offset) << shift); \
252+ dst += size / 8; \
253253 }
254254
255255 static int pcm_decode_frame(AVCodecContext *avctx, void *data,
256256 int *got_frame_ptr, AVPacket *avpkt)
257257 {
258258 const uint8_t *src = avpkt->data;
259− int buf_size = avpkt->size;
260− PCMDecode *s = avctx->priv_data;
259+ int buf_size = avpkt->size;
260+ PCMDecode *s = avctx->priv_data;
261261 int sample_size, c, n, ret, samples_per_block;
262262 uint8_t *samples;
263263 int32_t *dst_int32_t;
264264
265− sample_size = av_get_bits_per_sample(avctx->codec_id)/8;
265+ sample_size = av_get_bits_per_sample(avctx->codec_id) / 8;
266266
267267 /* av_get_bits_per_sample returns 0 for CODEC_ID_PCM_DVD */
268268 samples_per_block = 1;
@@ -276,11 +276,11 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 7 unmodified lines
276276 }
277277 /* 2 samples are interleaved per block in PCM_DVD */
278278 samples_per_block = 2;
279− sample_size = avctx->bits_per_coded_sample * 2 / 8;
279+ sample_size = avctx->bits_per_coded_sample * 2 / 8;
280280 } else if (avctx->codec_id == CODEC_ID_PCM_LXF) {
281281 /* we process 40-bit blocks per channel for LXF */
282282 samples_per_block = 2;
283− sample_size = 5;
283+ sample_size = 5;
284284 }
285285
286286 if (sample_size == 0) {
@@ -290,15 +290,15 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 3 unmodified lines
290290
291291 n = avctx->channels * sample_size;
292292
293− if(n && buf_size % n){
293+ if (n && buf_size % n) {
294294 if (buf_size < n) {
295295 av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
296296 return -1;
297− }else
297+ } else
298298 buf_size -= buf_size % n;
299299 }
300300
301− n = buf_size/sample_size;
301+ n = buf_size / sample_size;
302302
303303 /* get output buffer */
304304 s->frame.nb_samples = n * samples_per_block / avctx->channels;
@@ -308,7 +308,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 3 unmodified lines
308308 }
309309 samples = s->frame.data[0];
310310
311− switch(avctx->codec->id) {
311+ switch (avctx->codec->id) {
312312 case CODEC_ID_PCM_U32LE:
313313 DECODE(32, le32, src, samples, n, 0, 0x80000000)
314314 break;
@@ -328,21 +328,21 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 13 unmodified lines
328328 DECODE(32, be24, src, samples, n, 8, 0x800000)
329329 break;
330330 case CODEC_ID_PCM_S24DAUD:
331− for(;n>0;n--) {
332− uint32_t v = bytestream_get_be24(&src);
333− v >>= 4; // sync flags are here
334− AV_WN16A(samples, av_reverse[(v >> 8) & 0xff] +
335− (av_reverse[v & 0xff] << 8));
336− samples += 2;
331+ for (; n > 0; n--) {
332+ uint32_t v = bytestream_get_be24(&src);
333+ v >>= 4; // sync flags are here
334+ AV_WN16A(samples, av_reverse[(v >> 8) & 0xff] +
335+ (av_reverse[v & 0xff] << 8));
336+ samples += 2;
337337 }
338338 break;
339339 case CODEC_ID_PCM_S16LE_PLANAR:
340340 {
341341 int i;
342342 n /= avctx->channels;
343− for(c=0;c<avctx->channels;c++) {
343+ for (c = 0; c < avctx->channels; c++) {
344344 samples = s->frame.data[c];
345− for(i=n;i>0;i--) {
345+ for (i = n; i > 0; i--) {
346346 AV_WN16A(samples, bytestream_get_le16(&src));
347347 samples += 2;
348348 }
@@ -356,9 +356,8 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 7 unmodified lines
356356 DECODE(16, be16, src, samples, n, 0, 0x8000)
357357 break;
358358 case CODEC_ID_PCM_S8:
359− for(;n>0;n--) {
359+ for (; n > 0; n--)
360360 *samples++ = *src++ + 128;
361− }
362361 break;
363362 #if HAVE_BIGENDIAN
364363 case CODEC_ID_PCM_F64LE:
@@ -392,7 +391,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 27 unmodified lines
392391 case CODEC_ID_PCM_S16LE:
393392 #endif /* HAVE_BIGENDIAN */
394393 case CODEC_ID_PCM_U8:
395− memcpy(samples, src, n*sample_size);
394+ memcpy(samples, src, n * sample_size);
396395 break;
397396 case CODEC_ID_PCM_ZORK:
398397 for (; n > 0; n--) {
@@ -404,7 +403,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 5 unmodified lines
404403 break;
405404 case CODEC_ID_PCM_ALAW:
406405 case CODEC_ID_PCM_MULAW:
407− for(;n>0;n--) {
406+ for (; n > 0; n--) {
408407 AV_WN16A(samples, s->table[*src++]);
409408 samples += 2;
410409 }
@@ -417,19 +416,19 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 6 unmodified lines
417416 switch (avctx->bits_per_coded_sample) {
418417 case 20:
419418 while (n--) {
420− c = avctx->channels;
421− src8 = src + 4*c;
419+ c = avctx->channels;
420+ src8 = src + 4 * c;
422421 while (c--) {
423− *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8 &0xf0) << 8);
424− *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++ &0x0f) << 12);
422+ *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8 & 0xf0) << 8);
423+ *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++ & 0x0f) << 12);
425424 }
426425 src = src8;
427426 }
428427 break;
429428 case 24:
430429 while (n--) {
431− c = avctx->channels;
432− src8 = src + 4*c;
430+ c = avctx->channels;
431+ src8 = src + 4 * c;
433432 while (c--) {
434433 *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8);
435434 *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8);
@@ -449,11 +448,17 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 13 unmodified lines
449448 dst_int32_t = (int32_t *)s->frame.data[c];
450449 for (i = 0; i < n; i++) {
451450 //extract low 20 bits and expand to 32 bits
452− *dst_int32_t++ = (src[2] << 28) | (src[1] << 20) | (src[0] << 12) |
453− ((src[2] & 0xF) << 8) | src[1];
451+ *dst_int32_t++ = (src[2] << 28) |
452+ (src[1] << 20) |
453+ (src[0] << 12) |
454+ ((src[2] & 0xF) << 8) |
455+ src[1];
454456 //extract high 20 bits and expand to 32 bits
455− *dst_int32_t++ = (src[4] << 24) | (src[3] << 16) |
456− ((src[2] & 0xF0) << 8) | (src[4] << 4) | (src[3] >> 4);
457+ *dst_int32_t++ = (src[4] << 24) |
458+ (src[3] << 16) |
459+ ((src[2] & 0xF0) << 8) |
460+ (src[4] << 4) |
461+ (src[3] >> 4);
457462 src += 5;
458463 }
459464 }
@@ -470,65 +475,69 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, · 10 unmodified lines
470475 }
471476
472477 #if CONFIG_ENCODERS
473−#define PCM_ENCODER(id_,sample_fmt_,name_,long_name_) \
474−AVCodec ff_ ## name_ ## _encoder = { \
475− .name = #name_, \
476− .type = AVMEDIA_TYPE_AUDIO, \
477− .id = id_, \
478− .init = pcm_encode_init, \
479− .encode2 = pcm_encode_frame, \
480− .close = pcm_encode_close, \
481− .capabilities = CODEC_CAP_VARIABLE_FRAME_SIZE, \
482− .sample_fmts = (const enum AVSampleFormat[]){sample_fmt_,AV_SAMPLE_FMT_NONE}, \
483− .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
478+#define PCM_ENCODER(id_, sample_fmt_, name_, long_name_) \
479+AVCodec ff_ ## name_ ## _encoder = { \
480+ .name = #name_, \
481+ .type = AVMEDIA_TYPE_AUDIO, \
482+ .id = id_, \
483+ .init = pcm_encode_init, \
484+ .encode2 = pcm_encode_frame, \
485+ .close = pcm_encode_close, \
486+ .capabilities = CODEC_CAP_VARIABLE_FRAME_SIZE, \
487+ .sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \
488+ AV_SAMPLE_FMT_NONE }, \
489+ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
484490 }
485491 #else
486−#define PCM_ENCODER(id,sample_fmt_,name,long_name_)
492+#define PCM_ENCODER(id, sample_fmt_, name, long_name_)
487493 #endif
488494
489495 #if CONFIG_DECODERS
490−#define PCM_DECODER(id_,sample_fmt_,name_,long_name_) \
491−AVCodec ff_ ## name_ ## _decoder = { \
492− .name = #name_, \
493− .type = AVMEDIA_TYPE_AUDIO, \
494− .id = id_, \
495− .priv_data_size = sizeof(PCMDecode), \
496− .init = pcm_decode_init, \
497− .decode = pcm_decode_frame, \
498− .capabilities = CODEC_CAP_DR1, \
499− .sample_fmts = (const enum AVSampleFormat[]){sample_fmt_,AV_SAMPLE_FMT_NONE}, \
500− .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
496+#define PCM_DECODER(id_, sample_fmt_, name_, long_name_) \
497+AVCodec ff_ ## name_ ## _decoder = { \
498+ .name = #name_, \
499+ .type = AVMEDIA_TYPE_AUDIO, \
500+ .id = id_, \
501+ .priv_data_size = sizeof(PCMDecode), \
502+ .init = pcm_decode_init, \
503+ .decode = pcm_decode_frame, \
504+ .capabilities = CODEC_CAP_DR1, \
505+ .sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \
506+ AV_SAMPLE_FMT_NONE }, \
507+ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
501508 }
502509 #else
503−#define PCM_DECODER(id,sample_fmt_,name,long_name_)
510+#define PCM_DECODER(id, sample_fmt_, name, long_name_)
504511 #endif
505512
506−#define PCM_CODEC(id, sample_fmt_, name, long_name_) \
507− PCM_ENCODER(id,sample_fmt_,name,long_name_); PCM_DECODER(id,sample_fmt_,name,long_name_)
513+#define PCM_CODEC(id, sample_fmt_, name, long_name_) \
514+ PCM_ENCODER(id, sample_fmt_, name, long_name_); \
515+ PCM_DECODER(id, sample_fmt_, name, long_name_)
508516
509517 /* Note: Do not forget to add new entries to the Makefile as well. */
510−PCM_CODEC (CODEC_ID_PCM_ALAW, AV_SAMPLE_FMT_S16, pcm_alaw, "PCM A-law / G.711 A-law");
511−PCM_DECODER(CODEC_ID_PCM_DVD, AV_SAMPLE_FMT_S32, pcm_dvd, "PCM signed 20|24-bit big-endian");
512−PCM_CODEC (CODEC_ID_PCM_F32BE, AV_SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian");
513−PCM_CODEC (CODEC_ID_PCM_F32LE, AV_SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian");
514−PCM_CODEC (CODEC_ID_PCM_F64BE, AV_SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian");
515−PCM_CODEC (CODEC_ID_PCM_F64LE, AV_SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit floating point little-endian");
516−PCM_DECODER(CODEC_ID_PCM_LXF, AV_SAMPLE_FMT_S32P, pcm_lxf, "PCM signed 20-bit little-endian planar");
517−PCM_CODEC (CODEC_ID_PCM_MULAW, AV_SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law / G.711 mu-law");
518−PCM_CODEC (CODEC_ID_PCM_S8, AV_SAMPLE_FMT_U8, pcm_s8, "PCM signed 8-bit");
519−PCM_CODEC (CODEC_ID_PCM_S16BE, AV_SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian");
520−PCM_CODEC (CODEC_ID_PCM_S16LE, AV_SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian");
521−PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16P, pcm_s16le_planar, "PCM 16-bit little-endian planar");
522−PCM_CODEC (CODEC_ID_PCM_S24BE, AV_SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian");
523−PCM_CODEC (CODEC_ID_PCM_S24DAUD, AV_SAMPLE_FMT_S16, pcm_s24daud, "PCM D-Cinema audio signed 24-bit");
524−PCM_CODEC (CODEC_ID_PCM_S24LE, AV_SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian");
525−PCM_CODEC (CODEC_ID_PCM_S32BE, AV_SAMPLE_FMT_S32, pcm_s32be, "PCM signed 32-bit big-endian");
526−PCM_CODEC (CODEC_ID_PCM_S32LE, AV_SAMPLE_FMT_S32, pcm_s32le, "PCM signed 32-bit little-endian");
527−PCM_CODEC (CODEC_ID_PCM_U8, AV_SAMPLE_FMT_U8, pcm_u8, "PCM unsigned 8-bit");
528−PCM_CODEC (CODEC_ID_PCM_U16BE, AV_SAMPLE_FMT_S16, pcm_u16be, "PCM unsigned 16-bit big-endian");
529−PCM_CODEC (CODEC_ID_PCM_U16LE, AV_SAMPLE_FMT_S16, pcm_u16le, "PCM unsigned 16-bit little-endian");
530−PCM_CODEC (CODEC_ID_PCM_U24BE, AV_SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-bit big-endian");
531−PCM_CODEC (CODEC_ID_PCM_U24LE, AV_SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned 24-bit little-endian");
532−PCM_CODEC (CODEC_ID_PCM_U32BE, AV_SAMPLE_FMT_S32, pcm_u32be, "PCM unsigned 32-bit big-endian");
533−PCM_CODEC (CODEC_ID_PCM_U32LE, AV_SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned 32-bit little-endian");
534−PCM_DECODER(CODEC_ID_PCM_ZORK, AV_SAMPLE_FMT_U8, pcm_zork, "PCM Zork");
518+PCM_CODEC (CODEC_ID_PCM_ALAW, AV_SAMPLE_FMT_S16, pcm_alaw, "PCM A-law / G.711 A-law");
519+PCM_DECODER(CODEC_ID_PCM_DVD, AV_SAMPLE_FMT_S32, pcm_dvd, "PCM signed 20|24-bit big-endian");
520+PCM_CODEC (CODEC_ID_PCM_F32BE, AV_SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian");
521+PCM_CODEC (CODEC_ID_PCM_F32LE, AV_SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian");
522+PCM_CODEC (CODEC_ID_PCM_F64BE, AV_SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian");
523+PCM_CODEC (CODEC_ID_PCM_F64LE, AV_SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit floating point little-endian");
524+PCM_DECODER(CODEC_ID_PCM_LXF, AV_SAMPLE_FMT_S32P,pcm_lxf, "PCM signed 20-bit little-endian planar");
525+PCM_CODEC (CODEC_ID_PCM_MULAW, AV_SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law / G.711 mu-law");
526+PCM_CODEC (CODEC_ID_PCM_S8, AV_SAMPLE_FMT_U8, pcm_s8, "PCM signed 8-bit");
527+PCM_CODEC (CODEC_ID_PCM_S16BE, AV_SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian");
528+PCM_CODEC (CODEC_ID_PCM_S16LE, AV_SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian");
529+PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16P,pcm_s16le_planar, "PCM 16-bit little-endian planar");
530+PCM_CODEC (CODEC_ID_PCM_S24BE, AV_SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian");
531+PCM_CODEC (CODEC_ID_PCM_S24DAUD, AV_SAMPLE_FMT_S16, pcm_s24daud, "PCM D-Cinema audio signed 24-bit");
532+PCM_CODEC (CODEC_ID_PCM_S24LE, AV_SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian");
533+PCM_CODEC (CODEC_ID_PCM_S32BE, AV_SAMPLE_FMT_S32, pcm_s32be, "PCM signed 32-bit big-endian");
534+PCM_CODEC (CODEC_ID_PCM_S32LE, AV_SAMPLE_FMT_S32, pcm_s32le, "PCM signed 32-bit little-endian");
535+PCM_CODEC (CODEC_ID_PCM_U8, AV_SAMPLE_FMT_U8, pcm_u8, "PCM unsigned 8-bit");
536+PCM_CODEC (CODEC_ID_PCM_U16BE, AV_SAMPLE_FMT_S16, pcm_u16be, "PCM unsigned 16-bit big-endian");
537+PCM_CODEC (CODEC_ID_PCM_U16LE, AV_SAMPLE_FMT_S16, pcm_u16le, "PCM unsigned 16-bit little-endian");
538+PCM_CODEC (CODEC_ID_PCM_U24BE, AV_SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-bit big-endian");
539+PCM_CODEC (CODEC_ID_PCM_U24LE, AV_SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned 24-bit little-endian");
540+PCM_CODEC (CODEC_ID_PCM_U32BE, AV_SAMPLE_FMT_S32, pcm_u32be, "PCM unsigned 32-bit big-endian");
541+PCM_CODEC (CODEC_ID_PCM_U32LE, AV_SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned 32-bit little-endian");
542+PCM_DECODER(CODEC_ID_PCM_ZORK, AV_SAMPLE_FMT_U8, pcm_zork, "PCM Zork");
543+
libavcodec/sbrdsp.h+3−3
@@ -18,8 +18,8 @@ · 17 unmodified lines
1818 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1919 */
2020
21−#ifndef LIBAVCODEC_SBRDSP_H
22−#define LIBAVCODEC_SBRDSP_H
21+#ifndef AVCODEC_SBRDSP_H
22+#define AVCODEC_SBRDSP_H
2323
2424 #include <stdint.h>
2525
@@ -48,4 +48,4 @@ void ff_sbrdsp_init(SBRDSPContext *s); · 22 unmodified lines
4848 void ff_sbrdsp_init_arm(SBRDSPContext *s);
4949 void ff_sbrdsp_init_x86(SBRDSPContext *s);
5050
51−#endif
51+#endif /* AVCODEC_SBRDSP_H */
libavcodec/tiffenc.c+1−1
@@ -77,7 +77,7 @@ typedef struct TiffEncoderContext { · 76 unmodified lines
7777 * @param need Needed bytes
7878 * @return 0 - ok, 1 - no free space
7979 */
80−inline static int check_size(TiffEncoderContext * s, uint64_t need)
80+static inline int check_size(TiffEncoderContext * s, uint64_t need)
8181 {
8282 if (s->buf_size < *s->buf - s->buf_start + need) {
8383 *s->buf = s->buf_start + s->buf_size + 1;
libavcodec/wma_common.c+1−1
@@ -28,7 +28,7 @@ · 27 unmodified lines
2828 *@param decode_flags codec compression features
2929 *@return log2 of the number of output samples per frame
3030 */
31−int av_cold ff_wma_get_frame_len_bits(int sample_rate, int version,
31+av_cold int ff_wma_get_frame_len_bits(int sample_rate, int version,
3232 unsigned int decode_flags)
3333 {
3434
libavcodec/wma_common.h+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323
2424 #include "libavutil/attributes.h"
2525
26−int av_cold ff_wma_get_frame_len_bits(int sample_rate, int version,
26+av_cold int ff_wma_get_frame_len_bits(int sample_rate, int version,
2727 unsigned int decode_flags);
2828
2929 #endif /* AVCODEC_WMA_COMMON_H */
libavcodec/wmaprodec.c+1−1
@@ -237,7 +237,7 @@ typedef struct WMAProDecodeCtx { · 236 unmodified lines
237237 *@brief helper function to print the most important members of the context
238238 *@param s context
239239 */
240−static void av_cold dump_context(WMAProDecodeCtx *s)
240+static av_cold void dump_context(WMAProDecodeCtx *s)
241241 {
242242 #define PRINT(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %d\n", a, b);
243243 #define PRINT_HEX(a, b) av_log(s->avctx, AV_LOG_DEBUG, " %s = %x\n", a, b);
libavdevice/fbdev.c+2−2
@@ -95,7 +95,7 @@ typedef struct { · 94 unmodified lines
9595 uint8_t *data; ///< framebuffer data
9696 } FBDevContext;
9797
98−av_cold static int fbdev_read_header(AVFormatContext *avctx)
98+static av_cold int fbdev_read_header(AVFormatContext *avctx)
9999 {
100100 FBDevContext *fbdev = avctx->priv_data;
101101 AVStream *st = NULL;
@@ -234,7 +234,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt) · 132 unmodified lines
234234 return fbdev->frame_size;
235235 }
236236
237−av_cold static int fbdev_read_close(AVFormatContext *avctx)
237+static av_cold int fbdev_read_close(AVFormatContext *avctx)
238238 {
239239 FBDevContext *fbdev = avctx->priv_data;
240240
libavformat/rtmpproto.c+21−1
@@ -138,8 +138,12 @@ static void gen_connect(URLContext *s, RTMPContext *rt, const char *proto, · 137 unmodified lines
138138 ff_amf_write_bool(&p, 0);
139139 ff_amf_write_field_name(&p, "capabilities");
140140 ff_amf_write_number(&p, 15.0);
141+
142+ /* Tell the server we support all the audio codecs except
143+ * SUPPORT_SND_INTEL (0x0008) and SUPPORT_SND_UNUSED (0x0010)
144+ * which are unused in the RTMP protocol implementation. */
141145 ff_amf_write_field_name(&p, "audioCodecs");
142− ff_amf_write_number(&p, 1639.0);
146+ ff_amf_write_number(&p, 4071.0);
143147 ff_amf_write_field_name(&p, "videoCodecs");
144148 ff_amf_write_number(&p, 252.0);
145149 ff_amf_write_field_name(&p, "videoFunction");
@@ -342,6 +346,21 @@ static void gen_pong(URLContext *s, RTMPContext *rt, RTMPPacket *ppkt) · 196 unmodified lines
342346 ff_rtmp_packet_destroy(&pkt);
343347 }
344348
349+/**
350+ * Generate server bandwidth message and send it to the server.
351+ */
352+static void gen_server_bw(URLContext *s, RTMPContext *rt)
353+{
354+ RTMPPacket pkt;
355+ uint8_t *p;
356+
357+ ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL, RTMP_PT_SERVER_BW, 0, 4);
358+ p = pkt.data;
359+ bytestream_put_be32(&p, 2500000);
360+ ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]);
361+ ff_rtmp_packet_destroy(&pkt);
362+}
363+
345364 /**
346365 * Generate report on bytes read so far and send it to the server.
347366 */
@@ -603,6 +622,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) · 255 unmodified lines
603622 gen_fcpublish_stream(s, rt);
604623 rt->state = STATE_RELEASING;
605624 } else {
625+ gen_server_bw(s, rt);
606626 rt->state = STATE_CONNECTING;
607627 }
608628 gen_create_stream(s, rt);
libavutil/lfg.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #include "intreadwrite.h"
2828 #include "attributes.h"
2929
30−void av_cold av_lfg_init(AVLFG *c, unsigned int seed)
30+av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
3131 {
3232 uint8_t tmp[16] = { 0 };
3333 int i;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t