Browse code

Merge remote-tracking branch 'qatar/master'

* qatar/master:
x86: cabac: replace explicit memory references with "m" operands
avplay: don't request a stereo downmix
wmapro: use av_float2int()
lavc: avoid invalid memcpy() in avcodec_default_release_buffer()
lavu: replace int/float punning functions
lavfi: install libavfilter/vsrc_buffer.h
Remove extraneous semicolons
sdp: Restore the original mp4 format h264 extradata if converted
rtpenc: Add support for mp4 format h264
rtpenc: Simplify code by introducing a separate end pointer
movenc: Use the actual converted sample for RTP hinting
Fix a bunch of common typos.

Conflicts:
doc/developer.texi
doc/eval.texi
doc/filters.texi
doc/protocols.texi
ffmpeg.c
ffplay.c
libavcodec/mpegvideo.h
libavcodec/x86/cabac.h
libavfilter/Makefile
libavformat/avformat.h
libavformat/cafdec.c
libavformat/flvdec.c
libavformat/flvenc.c
libavformat/gxfenc.c
libavformat/img2.c
libavformat/movenc.c
libavformat/mpegts.c
libavformat/rtpenc_h264.c
libavformat/utils.c
libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/12/12 09:25:37
Showing 78 changed files
... ...
@@ -3783,7 +3783,7 @@ static void opt_output_file(void *optctx, const char *filename)
3783 3783
     }
3784 3784
 
3785 3785
     if (!(oc->oformat->flags & AVFMT_NOFILE)) {
3786
-        /* test if it already exists to avoid loosing precious files */
3786
+        /* test if it already exists to avoid losing precious files */
3787 3787
         assert_file_overwrite(filename);
3788 3788
 
3789 3789
         /* open the file */
... ...
@@ -91,7 +91,7 @@ int opt_timelimit(const char *opt, const char *arg);
91 91
  * parsed or the corresponding value is invalid.
92 92
  *
93 93
  * @param context the context of the value to be set (e.g. the
94
- * corresponding commandline option name)
94
+ * corresponding command line option name)
95 95
  * @param numstr the string to be parsed
96 96
  * @param type the type (OPT_INT64 or OPT_FLOAT) as which the
97 97
  * string should be parsed
... ...
@@ -106,7 +106,7 @@ double parse_number_or_die(const char *context, const char *numstr, int type, do
106 106
  * the string cannot be correctly parsed.
107 107
  *
108 108
  * @param context the context of the value to be set (e.g. the
109
- * corresponding commandline option name)
109
+ * corresponding command line option name)
110 110
  * @param timestr the string to be parsed
111 111
  * @param is_duration a flag which tells how to interpret timestr, if
112 112
  * not zero timestr is interpreted as a duration, otherwise as a
... ...
@@ -189,7 +189,7 @@ void parse_options(void *optctx, int argc, char **argv, const OptionDef *options
189 189
 int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options);
190 190
 
191 191
 /**
192
- * Find the '-loglevel' option in the commandline args and apply it.
192
+ * Find the '-loglevel' option in the command line args and apply it.
193 193
  */
194 194
 void parse_loglevel(int argc, char **argv, const OptionDef *options);
195 195
 
... ...
@@ -29,7 +29,7 @@ rates and resize video on the fly with a high quality polyphase filter.
29 29
 avconv reads from an arbitrary number of input "files" (which can be regular
30 30
 files, pipes, network streams, grabbing devices, etc.), specified by the
31 31
 @code{-i} option, and writes to an arbitrary number of output "files", which are
32
-specified by a plain output filename. Anything found on the commandline which
32
+specified by a plain output filename. Anything found on the command line which
33 33
 cannot be interpreted as an option is considered to be an output filename.
34 34
 
35 35
 Each input or output file can in principle contain any number of streams of
... ...
@@ -147,7 +147,7 @@ that only captures in stereo and also requires that one channel be flipped.
147 147
 If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before
148 148
 starting ffmpeg.
149 149
 
150
-@subsection The audio and video loose sync after a while.
150
+@subsection The audio and video lose sync after a while.
151 151
 
152 152
 Yes, they do.
153 153
 
... ...
@@ -155,8 +155,8 @@ be seekable, so they will fail with the pipe output protocol.
155 155
 
156 156
 Real-Time Messaging Protocol.
157 157
 
158
-The Real-Time Messaging Protocol (RTMP) is used for streaming
159
-multimedia content across a TCP/IP network.
158
+The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
159
+content across a TCP/IP network.
160 160
 
161 161
 The required syntax is:
162 162
 @example
... ...
@@ -18,7 +18,7 @@ essential that changes to their codebase are publicly visible, clean and
18 18
 easy reviewable that again leads us to:
19 19
 * use of a revision control system like git
20 20
 * separation of cosmetic from non-cosmetic changes (this is almost entirely
21
-  ignored by mentors and students in soc 2006 which might lead to a suprise
21
+  ignored by mentors and students in soc 2006 which might lead to a surprise
22 22
   when the code will be reviewed at the end before a possible inclusion in
23 23
   FFmpeg, individual changes were generally not reviewable due to cosmetics).
24 24
 * frequent commits, so that comments can be provided early
... ...
@@ -4162,7 +4162,7 @@ static void opt_output_file(void *optctx, const char *filename)
4162 4162
     }
4163 4163
 
4164 4164
     if (!(oc->oformat->flags & AVFMT_NOFILE)) {
4165
-        /* test if it already exists to avoid loosing precious files */
4165
+        /* test if it already exists to avoid losing precious files */
4166 4166
         assert_file_overwrite(filename);
4167 4167
 
4168 4168
         /* open the file */
... ...
@@ -2468,8 +2468,6 @@ static int read_thread(void *arg)
2468 2468
     if(genpts)
2469 2469
         ic->flags |= AVFMT_FLAG_GENPTS;
2470 2470
 
2471
-    av_dict_set(&codec_opts, "request_channels", "2", 0);
2472
-
2473 2471
     opts = setup_find_stream_info_opts(ic, codec_opts);
2474 2472
     orig_nb_streams = ic->nb_streams;
2475 2473
 
... ...
@@ -475,7 +475,7 @@ static void start_children(FFStream *feed)
475 475
                     slash++;
476 476
                 strcpy(slash, "ffmpeg");
477 477
 
478
-                http_log("Launch commandline: ");
478
+                http_log("Launch command line: ");
479 479
                 http_log("%s ", pathname);
480 480
                 for (i = 1; feed->child_argv[i] && feed->child_argv[i][0]; i++)
481 481
                     http_log("%s ", feed->child_argv[i]);
... ...
@@ -1348,7 +1348,7 @@ typedef struct AVCodecContext {
1348 1348
      * Some codecs need additional format info. It is stored here.
1349 1349
      * If any muxer uses this then ALL demuxers/parsers AND encoders for the
1350 1350
      * specific codec MUST set it correctly otherwise stream copy breaks.
1351
-     * In general use of this field by muxers is not recommanded.
1351
+     * In general use of this field by muxers is not recommended.
1352 1352
      * - encoding: Set by libavcodec.
1353 1353
      * - decoding: Set by libavcodec. (FIXME: Is this OK?)
1354 1354
      */
... ...
@@ -3541,7 +3541,7 @@ typedef struct ReSampleContext ReSampleContext;
3541 3541
  * @param linear           if 1 then the used FIR filter will be linearly interpolated
3542 3542
                            between the 2 closest, if 0 the closest will be used
3543 3543
  * @param cutoff           cutoff frequency, 1.0 corresponds to half the output sampling rate
3544
- * @return allocated ReSampleContext, NULL if error occured
3544
+ * @return allocated ReSampleContext, NULL if error occurred
3545 3545
  */
3546 3546
 ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
3547 3547
                                         int output_rate, int input_rate,
... ...
@@ -35,7 +35,7 @@
35 35
 #include "dct.h"
36 36
 #include "rdft.h"
37 37
 #include "fmtconvert.h"
38
-#include "libavutil/intfloat_readwrite.h"
38
+#include "libavutil/intfloat.h"
39 39
 
40 40
 extern const uint16_t ff_wma_critical_freqs[25];
41 41
 
... ...
@@ -193,8 +193,8 @@ static int decode_block(BinkAudioContext *s, int16_t *out, int use_dct)
193 193
         if (s->version_b) {
194 194
             if (get_bits_left(gb) < 64)
195 195
                 return AVERROR_INVALIDDATA;
196
-            coeffs[0] = av_int2flt(get_bits(gb, 32)) * s->root;
197
-            coeffs[1] = av_int2flt(get_bits(gb, 32)) * s->root;
196
+            coeffs[0] = av_int2float(get_bits_long(gb, 32)) * s->root;
197
+            coeffs[1] = av_int2float(get_bits_long(gb, 32)) * s->root;
198 198
         } else {
199 199
             if (get_bits_left(gb) < 58)
200 200
                 return AVERROR_INVALIDDATA;
... ...
@@ -103,7 +103,7 @@ static int alloc_table(VLC *vlc, int size, int use_static)
103 103
     vlc->table_size += size;
104 104
     if (vlc->table_size > vlc->table_allocated) {
105 105
         if(use_static)
106
-            abort(); //cant do anything, init_vlc() is used with too little memory
106
+            abort(); // cannot do anything, init_vlc() is used with too little memory
107 107
         vlc->table_allocated += (1 << vlc->bits);
108 108
         vlc->table = av_realloc_f(vlc->table,
109 109
                                   vlc->table_allocated, sizeof(VLC_TYPE) * 2);
... ...
@@ -157,7 +157,7 @@ static int tgv_decode_inter(TgvContext * s, const uint8_t *buf, const uint8_t *b
157 157
     vector_bits       = AV_RL16(&buf[6]);
158 158
     buf += 12;
159 159
 
160
-    /* allocate codebook buffers as neccessary */
160
+    /* allocate codebook buffers as necessary */
161 161
     if (num_mvs > s->num_mvs) {
162 162
         s->mv_codebook = av_realloc(s->mv_codebook, num_mvs*2*sizeof(int));
163 163
         s->num_mvs = num_mvs;
... ...
@@ -293,7 +293,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
293 293
         s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
294 294
         s->frame.linesize[0] = s->width;
295 295
 
296
-        /* allocate additional 12 bytes to accomodate av_memcpy_backptr() OUTBUF_PADDED optimisation */
296
+        /* allocate additional 12 bytes to accommodate av_memcpy_backptr() OUTBUF_PADDED optimisation */
297 297
         s->frame.data[0] = av_malloc(s->width*s->height + 12);
298 298
         if (!s->frame.data[0])
299 299
             return AVERROR(ENOMEM);
... ...
@@ -801,7 +801,7 @@ void ff_er_frame_end(MpegEncContext *s){
801 801
     if(!s->error_recognition || s->error_count==0 || s->avctx->lowres ||
802 802
        s->avctx->hwaccel ||
803 803
        s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
804
-       s->picture_structure != PICT_FRAME || // we dont support ER of field pictures yet, though it should not crash if enabled
804
+       s->picture_structure != PICT_FRAME || // we do not support ER of field pictures yet, though it should not crash if enabled
805 805
        s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return;
806 806
 
807 807
     if (s->current_picture.f.motion_val[0] == NULL) {
... ...
@@ -153,7 +153,7 @@ static int g722_encode_trellis(AVCodecContext *avctx,
153 153
 
154 154
         for (j = 0; j < frontier && nodes[0][j]; j++) {
155 155
             /* Only k >> 2 affects the future adaptive state, therefore testing
156
-             * small steps that don't change k >> 2 is useless, the orignal
156
+             * small steps that don't change k >> 2 is useless, the original
157 157
              * value from encode_low is better than them. Since we step k
158 158
              * in steps of 4, make sure range is a multiple of 4, so that
159 159
              * we don't miss the original value from encode_low. */
... ...
@@ -2201,8 +2201,8 @@ static av_always_inline void hl_decode_mb_444_internal(H264Context *h, int simpl
2201 2201
 static void hl_decode_mb_simple_ ## bits(H264Context *h){ \
2202 2202
     hl_decode_mb_internal(h, 1, sh); \
2203 2203
 }
2204
-hl_decode_mb_simple(0, 8);
2205
-hl_decode_mb_simple(1, 16);
2204
+hl_decode_mb_simple(0, 8)
2205
+hl_decode_mb_simple(1, 16)
2206 2206
 
2207 2207
 /**
2208 2208
  * Process a macroblock; this handles edge cases, such as interlacing.
... ...
@@ -2926,7 +2926,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2926 2926
              * FIXME: avoiding a memcpy would be nice, but ref handling makes many assumptions
2927 2927
              * about there being no actual duplicates.
2928 2928
              * FIXME: this doesn't copy padding for out-of-frame motion vectors.  Given we're
2929
-             * concealing a lost frame, this probably isn't noticable by comparison, but it should
2929
+             * concealing a lost frame, this probably isn't noticeable by comparison, but it should
2930 2930
              * be fixed. */
2931 2931
             if (h->short_ref_count) {
2932 2932
                 if (prev) {
... ...
@@ -3354,7 +3354,7 @@ static av_always_inline void fill_filter_caches_inter(H264Context *h, MpegEncCon
3354 3354
 
3355 3355
 /**
3356 3356
  *
3357
- * @return non zero if the loop filter can be skiped
3357
+ * @return non zero if the loop filter can be skipped
3358 3358
  */
3359 3359
 static int fill_filter_caches(H264Context *h, int mb_type){
3360 3360
     MpegEncContext * const s = &h->s;
... ...
@@ -3879,7 +3879,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
3879 3879
                 av_log(h->s.avctx, AV_LOG_ERROR, "Invalid mix of idr and non-idr slices");
3880 3880
                 return -1;
3881 3881
             }
3882
-            idr(h); //FIXME ensure we don't loose some frames if there is reordering
3882
+            idr(h); // FIXME ensure we don't lose some frames if there is reordering
3883 3883
         case NAL_SLICE:
3884 3884
             init_get_bits(&hx->s.gb, ptr, bit_length);
3885 3885
             hx->intra_gb_ptr=
... ...
@@ -388,9 +388,9 @@ static void FUNCC(pred16x16_##n##_dc)(uint8_t *_src, int stride){\
388 388
     PREDICT_16x16_DC(PIXEL_SPLAT_X4(v));\
389 389
 }
390 390
 
391
-PRED16x16_X(127, (1<<(BIT_DEPTH-1))-1);
392
-PRED16x16_X(128, (1<<(BIT_DEPTH-1))+0);
393
-PRED16x16_X(129, (1<<(BIT_DEPTH-1))+1);
391
+PRED16x16_X(127, (1<<(BIT_DEPTH-1))-1)
392
+PRED16x16_X(128, (1<<(BIT_DEPTH-1))+0)
393
+PRED16x16_X(129, (1<<(BIT_DEPTH-1))+1)
394 394
 
395 395
 static inline void FUNCC(pred16x16_plane_compat)(uint8_t *p_src, int p_stride, const int svq3, const int rv40){
396 396
   int i, j, k;
... ...
@@ -502,9 +502,9 @@ static void FUNCC(pred8x8_##n##_dc)(uint8_t *_src, int stride){\
502 502
     }\
503 503
 }
504 504
 
505
-PRED8x8_X(127, (1<<(BIT_DEPTH-1))-1);
506
-PRED8x8_X(128, (1<<(BIT_DEPTH-1))+0);
507
-PRED8x8_X(129, (1<<(BIT_DEPTH-1))+1);
505
+PRED8x8_X(127, (1<<(BIT_DEPTH-1))-1)
506
+PRED8x8_X(128, (1<<(BIT_DEPTH-1))+0)
507
+PRED8x8_X(129, (1<<(BIT_DEPTH-1))+1)
508 508
 
509 509
 static void FUNCC(pred8x16_128_dc)(uint8_t *_src, int stride){
510 510
     FUNCC(pred8x8_128_dc)(_src, stride);
... ...
@@ -340,7 +340,7 @@ FUNC(ff_jpeg_fdct_islow)(DCTELEM *data)
340 340
 
341 341
 /*
342 342
  * The secret of DCT2-4-8 is really simple -- you do the usual 1-DCT
343
- * on the rows and then, instead of doing even and odd, part on the colums
343
+ * on the rows and then, instead of doing even and odd, part on the columns
344 344
  * you do even part two times.
345 345
  */
346 346
 GLOBAL(void)
... ...
@@ -67,7 +67,7 @@ typedef struct LPCContext {
67 67
      * Perform autocorrelation on input samples with delay of 0 to lag.
68 68
      * @param data  input samples.
69 69
      *              constraints: no alignment needed, but must have have at
70
-     *              least lag*sizeof(double) valid bytes preceeding it, and
70
+     *              least lag*sizeof(double) valid bytes preceding it, and
71 71
      *              size must be at least (len+1)*sizeof(double) if data is
72 72
      *              16-byte aligned or (len+2)*sizeof(double) if data is
73 73
      *              unaligned.
... ...
@@ -1114,9 +1114,9 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
1114 1114
         av_log(s->avctx, AV_LOG_DEBUG, "APPx %8X\n", id);
1115 1115
     }
1116 1116
 
1117
-    /* buggy AVID, it puts EOI only at every 10th frame */
1118
-    /* also this fourcc is used by non-avid files too, it holds some
1119
-       informations, but it's always present in AVID creates files */
1117
+    /* Buggy AVID, it puts EOI only at every 10th frame. */
1118
+    /* Also, this fourcc is used by non-avid files too, it holds some
1119
+       information, but it's always present in AVID-created files. */
1120 1120
     if (id == AV_RL32("AVI1"))
1121 1121
     {
1122 1122
         /* structure:
... ...
@@ -559,7 +559,7 @@ static int decode_slice(AVCodecContext *avctx, ProresThreadData *td)
559 559
     sf = sf > 128 ? (sf - 96) << 2 : sf;
560 560
 
561 561
     /* scale quantization matrixes according with slice's scale factor */
562
-    /* TODO: this can be SIMD-optimized alot */
562
+    /* TODO: this can be SIMD-optimized a lot */
563 563
     if (ctx->qmat_changed || sf != ctx->prev_slice_sf) {
564 564
         ctx->prev_slice_sf = sf;
565 565
         for (i = 0; i < 64; i++) {
... ...
@@ -156,7 +156,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
156 156
              return -1;
157 157
     }
158 158
     c->bpp = avctx->bits_per_coded_sample;
159
-    // buffer size for RLE 'best' case when 2-byte code preceeds each pixel and there may be padding after it too
159
+    // buffer size for RLE 'best' case when 2-byte code precedes each pixel and there may be padding after it too
160 160
     c->decomp_size = (((avctx->width * c->bpp + 7) >> 3) + 3 * avctx->width + 2) * avctx->height + 2;
161 161
 
162 162
     /* Allocate decompression buffer */
... ...
@@ -544,7 +544,8 @@ void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
544 544
         avci->buffer_count--;
545 545
         last = &avci->buffer[avci->buffer_count];
546 546
 
547
-        FFSWAP(InternalBuffer, *buf, *last);
547
+        if (buf != last)
548
+            FFSWAP(InternalBuffer, *buf, *last);
548 549
     }
549 550
 
550 551
     for (i = 0; i < AV_NUM_DATA_POINTERS; i++) {
... ...
@@ -98,7 +98,7 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
98 98
         pic_param->forward_reference_picture  = ff_vaapi_get_surface_id(&s->last_picture);
99 99
 
100 100
     /* Fill in VAIQMatrixBufferMPEG4 */
101
-    /* Only the first inverse quantisation method uses the weighthing matrices */
101
+    /* Only the first inverse quantisation method uses the weighting matrices */
102 102
     if (pic_param->vol_fields.bits.quant_type) {
103 103
         iq_matrix = ff_vaapi_alloc_iq_matrix(vactx, sizeof(VAIQMatrixBufferMPEG4));
104 104
         if (!iq_matrix)
... ...
@@ -3536,7 +3536,7 @@ static void vc1_apply_p_loop_filter(VC1Context *v)
3536 3536
         vc1_apply_p_v_loop_filter(v, i);
3537 3537
     }
3538 3538
 
3539
-    /* V always preceedes H, therefore we run H one MB before V;
3539
+    /* V always precedes H, therefore we run H one MB before V;
3540 3540
      * at the end of a row, we catch up to complete the row */
3541 3541
     if (s->mb_x) {
3542 3542
         for (i = 0; i < 6; i++) {
... ...
@@ -3573,7 +3573,7 @@ static int vc1_decode_p_mb(VC1Context *v)
3573 3573
     int skipped, fourmv;
3574 3574
     int block_cbp = 0, pat, block_tt = 0, block_intra = 0;
3575 3575
 
3576
-    mquant = v->pq; /* Loosy initialization */
3576
+    mquant = v->pq; /* lossy initialization */
3577 3577
 
3578 3578
     if (v->mv_type_is_raw)
3579 3579
         fourmv = get_bits1(gb);
... ...
@@ -4141,7 +4141,7 @@ static void vc1_decode_b_mb(VC1Context *v)
4141 4141
     int dmv_x[2], dmv_y[2];
4142 4142
     int bmvtype = BMV_TYPE_BACKWARD;
4143 4143
 
4144
-    mquant      = v->pq; /* Loosy initialization */
4144
+    mquant      = v->pq; /* lossy initialization */
4145 4145
     s->mb_intra = 0;
4146 4146
 
4147 4147
     if (v->dmb_is_raw)
... ...
@@ -550,8 +550,8 @@ static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src,
550 550
     return 0; /* should not occur */                                    \
551 551
 }
552 552
 
553
-VC1_MSPEL_FILTER_16B(ver, uint8_t);
554
-VC1_MSPEL_FILTER_16B(hor, int16_t);
553
+VC1_MSPEL_FILTER_16B(ver, uint8_t)
554
+VC1_MSPEL_FILTER_16B(hor, int16_t)
555 555
 
556 556
 
557 557
 /** Filter used to interpolate fractional pel values
... ...
@@ -86,6 +86,7 @@
86 86
  * subframe in order to reconstruct the output samples.
87 87
  */
88 88
 
89
+#include "libavutil/intfloat.h"
89 90
 #include "libavutil/intreadwrite.h"
90 91
 #include "avcodec.h"
91 92
 #include "internal.h"
... ...
@@ -823,8 +824,8 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c)
823 823
                     v1 = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
824 824
                     if (v1 == HUFF_VEC1_SIZE - 1)
825 825
                         v1 += ff_wma_get_large_val(&s->gb);
826
-                    vals[i  ] = ((av_alias32){ .f32 = v0 }).u32;
827
-                    vals[i+1] = ((av_alias32){ .f32 = v1 }).u32;
826
+                    vals[i  ] = av_float2int(v0);
827
+                    vals[i+1] = av_float2int(v1);
828 828
                 } else {
829 829
                     vals[i]   = fval_tab[symbol_to_vec2[idx] >> 4 ];
830 830
                     vals[i+1] = fval_tab[symbol_to_vec2[idx] & 0xF];
... ...
@@ -1425,7 +1426,7 @@ static int remaining_bits(WMAProDecodeCtx *s, GetBitContext *gb)
1425 1425
  *@param s codec context
1426 1426
  *@param gb bitstream reader context
1427 1427
  *@param len length of the partial frame
1428
- *@param append decides wether to reset the buffer or not
1428
+ *@param append decides whether to reset the buffer or not
1429 1429
  */
1430 1430
 static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
1431 1431
                       int append)
... ...
@@ -189,7 +189,7 @@ typedef struct {
189 189
      * @{
190 190
      */
191 191
     int spillover_nbits;          ///< number of bits of the previous packet's
192
-                                  ///< last superframe preceeding this
192
+                                  ///< last superframe preceding this
193 193
                                   ///< packet's first full superframe (useful
194 194
                                   ///< for re-synchronization also)
195 195
     int has_residual_lsps;        ///< if set, superframes contain one set of
... ...
@@ -1805,7 +1805,7 @@ static int synth_superframe(AVCodecContext *ctx, int *got_frame_ptr)
1805 1805
     s->frame.nb_samples = n_samples;
1806 1806
     samples = (float *)s->frame.data[0];
1807 1807
 
1808
-    /* Parse frames, optionally preceeded by per-frame (independent) LSPs. */
1808
+    /* Parse frames, optionally preceded by per-frame (independent) LSPs. */
1809 1809
     for (n = 0; n < 3; n++) {
1810 1810
         if (!s->has_residual_lsps) {
1811 1811
             int m;
... ...
@@ -27,7 +27,7 @@
27 27
 #include "config.h"
28 28
 
29 29
 #if HAVE_FAST_CMOV
30
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp)\
30
+#define BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)\
31 31
         "mov    "tmp"       , %%ecx     \n\t"\
32 32
         "shl    $17         , "tmp"     \n\t"\
33 33
         "cmp    "low"       , "tmp"     \n\t"\
... ...
@@ -37,7 +37,7 @@
37 37
         "xor    %%ecx       , "ret"     \n\t"\
38 38
         "sub    "tmp"       , "low"     \n\t"
39 39
 #else /* HAVE_FAST_CMOV */
40
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp)\
40
+#define BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)\
41 41
         "mov    "tmp"       , %%ecx     \n\t"\
42 42
         "shl    $17         , "tmp"     \n\t"\
43 43
         "sub    "low"       , "tmp"     \n\t"\
... ...
@@ -51,14 +51,13 @@
51 51
         "xor    "tmp"       , "ret"     \n\t"
52 52
 #endif /* HAVE_FAST_CMOV */
53 53
 
54
-#define BRANCHLESS_GET_CABAC(ret, cabac, statep, low, lowword, range, tmp, tmpbyte, byte) \
54
+#define BRANCHLESS_GET_CABAC(ret, statep, low, lowword, range, tmp, tmpbyte, byte) \
55 55
         "movzbl "statep"    , "ret"                                     \n\t"\
56 56
         "mov    "range"     , "tmp"                                     \n\t"\
57 57
         "and    $0xC0       , "range"                                   \n\t"\
58 58
         "movzbl "MANGLE(ff_h264_lps_range)"("ret", "range", 2), "range" \n\t"\
59 59
         "sub    "range"     , "tmp"                                     \n\t"\
60
-        BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword,        \
61
-                                    range, tmp)                              \
60
+        BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)   \
62 61
         "movzbl " MANGLE(ff_h264_norm_shift) "("range"), %%ecx          \n\t"\
63 62
         "shl    %%cl        , "range"                                   \n\t"\
64 63
         "movzbl "MANGLE(ff_h264_mlps_state)"+128("ret"), "tmp"          \n\t"\
... ...
@@ -66,8 +65,8 @@
66 66
         "mov    "tmpbyte"   , "statep"                                  \n\t"\
67 67
         "test   "lowword"   , "lowword"                                 \n\t"\
68 68
         " jnz   1f                                                      \n\t"\
69
-        "mov "byte"("cabac"), %%"REG_c"                                 \n\t"\
70
-        "add"OPSIZE" $2     , "byte    "("cabac")                       \n\t"\
69
+        "mov    "byte"      , %%"REG_c"                                 \n\t"\
70
+        "add"OPSIZE" $2     , "byte"                                    \n\t"\
71 71
         "movzwl (%%"REG_c")     , "tmp"                                 \n\t"\
72 72
         "lea    -1("low")   , %%ecx                                     \n\t"\
73 73
         "xor    "low"       , %%ecx                                     \n\t"\
... ...
@@ -82,38 +81,32 @@
82 82
         "add    "tmp"       , "low"                                     \n\t"\
83 83
         "1:                                                             \n\t"
84 84
 
85
-#if HAVE_7REGS && !defined(BROKEN_RELOCATIONS)
85
+#if HAVE_6REGS && !defined(BROKEN_RELOCATIONS)
86 86
 #define get_cabac_inline get_cabac_inline_x86
87 87
 static av_always_inline int get_cabac_inline_x86(CABACContext *c,
88 88
                                                  uint8_t *const state)
89 89
 {
90
-    int bit, low, range, tmp;
90
+    int bit, tmp;
91 91
 
92 92
     __asm__ volatile(
93
-        "movl %a6(%5), %2               \n\t"
94
-        "movl %a7(%5), %1               \n\t"
95
-        BRANCHLESS_GET_CABAC("%0", "%5", "(%4)", "%1", "%w1", "%2",
96
-                             "%3", "%b3", "%a8")
97
-        "movl %2, %a6(%5)               \n\t"
98
-        "movl %1, %a7(%5)               \n\t"
99
-
100
-        :"=&r"(bit), "=&r"(low), "=&r"(range), "=&q"(tmp)
101
-        :"r"(state), "r"(c),
102
-         "i"(offsetof(CABACContext, range)), "i"(offsetof(CABACContext, low)),
103
-         "i"(offsetof(CABACContext, bytestream))
93
+        BRANCHLESS_GET_CABAC("%0", "(%5)", "%1", "%w1", "%2",
94
+                             "%3", "%b3", "%4")
95
+        :"=&r"(bit), "+&r"(c->low), "+&r"(c->range), "=&q"(tmp),
96
+         "+m"(c->bytestream)
97
+        :"r"(state)
104 98
         : "%"REG_c, "memory"
105 99
     );
106 100
     return bit & 1;
107 101
 }
108
-#endif /* HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */
102
+#endif /* HAVE_6REGS && !defined(BROKEN_RELOCATIONS) */
109 103
 
110 104
 #define get_cabac_bypass_sign get_cabac_bypass_sign_x86
111 105
 static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
112 106
 {
113 107
     x86_reg tmp;
114 108
     __asm__ volatile(
115
-        "movl %a3(%2), %k1                      \n\t"
116
-        "movl %a4(%2), %%eax                    \n\t"
109
+        "movl %4, %k1                           \n\t"
110
+        "movl %2, %%eax                         \n\t"
117 111
         "shl $17, %k1                           \n\t"
118 112
         "add %%eax, %%eax                       \n\t"
119 113
         "sub %k1, %%eax                         \n\t"
... ...
@@ -124,22 +117,20 @@ static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
124 124
         "sub %%edx, %%ecx                       \n\t"
125 125
         "test %%ax, %%ax                        \n\t"
126 126
         " jnz 1f                                \n\t"
127
-        "mov  %a5(%2), %1                       \n\t"
127
+        "mov  %3, %1                            \n\t"
128 128
         "subl $0xFFFF, %%eax                    \n\t"
129 129
         "movzwl (%1), %%edx                     \n\t"
130 130
         "bswap %%edx                            \n\t"
131 131
         "shrl $15, %%edx                        \n\t"
132 132
         "add  $2, %1                            \n\t"
133 133
         "addl %%edx, %%eax                      \n\t"
134
-        "mov  %1, %a5(%2)                       \n\t"
134
+        "mov  %1, %3                            \n\t"
135 135
         "1:                                     \n\t"
136
-        "movl %%eax, %a4(%2)                    \n\t"
136
+        "movl %%eax, %2                         \n\t"
137 137
 
138
-        :"+c"(val), "=&r"(tmp)
139
-        :"r"(c),
140
-         "i"(offsetof(CABACContext, range)), "i"(offsetof(CABACContext, low)),
141
-         "i"(offsetof(CABACContext, bytestream))
142
-        : "%eax", "%edx", "memory"
138
+        :"+c"(val), "=&r"(tmp), "+m"(c->low), "+m"(c->bytestream)
139
+        :"m"(c->range)
140
+        : "%eax", "%edx"
143 141
     );
144 142
     return val;
145 143
 }
... ...
@@ -36,7 +36,7 @@
36 36
 
37 37
 //FIXME use some macros to avoid duplicating get_cabac (cannot be done yet
38 38
 //as that would make optimization work hard)
39
-#if HAVE_7REGS && !defined(BROKEN_RELOCATIONS)
39
+#if HAVE_6REGS && !defined(BROKEN_RELOCATIONS)
40 40
 static int decode_significance_x86(CABACContext *c, int max_coeff,
41 41
                                    uint8_t *significant_coeff_ctx_base,
42 42
                                    int *index, x86_reg last_off){
... ...
@@ -48,15 +48,15 @@ static int decode_significance_x86(CABACContext *c, int max_coeff,
48 48
     __asm__ volatile(
49 49
         "2:                                     \n\t"
50 50
 
51
-        BRANCHLESS_GET_CABAC("%4", "%6", "(%1)", "%3",
52
-                             "%w3", "%5", "%k0", "%b0", "%a11")
51
+        BRANCHLESS_GET_CABAC("%4", "(%1)", "%3",
52
+                             "%w3", "%5", "%k0", "%b0", "%6")
53 53
 
54 54
         "test $1, %4                            \n\t"
55 55
         " jz 3f                                 \n\t"
56 56
         "add  %10, %1                           \n\t"
57 57
 
58
-        BRANCHLESS_GET_CABAC("%4", "%6", "(%1)", "%3",
59
-                             "%w3", "%5", "%k0", "%b0", "%a11")
58
+        BRANCHLESS_GET_CABAC("%4", "(%1)", "%3",
59
+                             "%w3", "%5", "%k0", "%b0", "%6")
60 60
 
61 61
         "sub  %10, %1                           \n\t"
62 62
         "mov  %2, %0                            \n\t"
... ...
@@ -81,9 +81,9 @@ static int decode_significance_x86(CABACContext *c, int max_coeff,
81 81
         "add  %9, %k0                           \n\t"
82 82
         "shr $2, %k0                            \n\t"
83 83
         :"=&q"(coeff_count), "+r"(significant_coeff_ctx_base), "+m"(index),
84
-         "+&r"(c->low), "=&r"(bit), "+&r"(c->range)
85
-        :"r"(c), "m"(minusstart), "m"(end), "m"(minusindex), "m"(last_off),
86
-         "i"(offsetof(CABACContext, bytestream))
84
+         "+&r"(c->low), "=&r"(bit), "+&r"(c->range),
85
+         "+m"(c->bytestream)
86
+        :"m"(minusstart), "m"(end), "m"(minusindex), "m"(last_off)
87 87
         : "%"REG_c, "memory"
88 88
     );
89 89
     return coeff_count;
... ...
@@ -105,8 +105,8 @@ static int decode_significance_8x8_x86(CABACContext *c,
105 105
         "movzbl (%0, %6), %k6                   \n\t"
106 106
         "add %9, %6                             \n\t"
107 107
 
108
-        BRANCHLESS_GET_CABAC("%4", "%7", "(%6)", "%3",
109
-                             "%w3", "%5", "%k0", "%b0", "%a12")
108
+        BRANCHLESS_GET_CABAC("%4", "(%6)", "%3",
109
+                             "%w3", "%5", "%k0", "%b0", "%7")
110 110
 
111 111
         "mov %1, %k6                            \n\t"
112 112
         "test $1, %4                            \n\t"
... ...
@@ -115,8 +115,8 @@ static int decode_significance_8x8_x86(CABACContext *c,
115 115
         "movzbl "MANGLE(last_coeff_flag_offset_8x8)"(%k6), %k6\n\t"
116 116
         "add %11, %6                            \n\t"
117 117
 
118
-        BRANCHLESS_GET_CABAC("%4", "%7", "(%6)", "%3",
119
-                             "%w3", "%5", "%k0", "%b0", "%a12")
118
+        BRANCHLESS_GET_CABAC("%4", "(%6)", "%3",
119
+                             "%w3", "%5", "%k0", "%b0", "%7")
120 120
 
121 121
         "mov %2, %0                             \n\t"
122 122
         "mov %1, %k6                            \n\t"
... ...
@@ -138,13 +138,12 @@ static int decode_significance_8x8_x86(CABACContext *c,
138 138
         "addl %8, %k0                           \n\t"
139 139
         "shr $2, %k0                            \n\t"
140 140
         :"=&q"(coeff_count),"+m"(last), "+m"(index), "+&r"(c->low), "=&r"(bit),
141
-         "+&r"(c->range), "=&r"(state)
142
-        :"r"(c), "m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off), "m"(last_coeff_ctx_base),
143
-         "i"(offsetof(CABACContext, bytestream))
141
+         "+&r"(c->range), "=&r"(state), "+m"(c->bytestream)
142
+        :"m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off), "m"(last_coeff_ctx_base)
144 143
         : "%"REG_c, "memory"
145 144
     );
146 145
     return coeff_count;
147 146
 }
148
-#endif /* HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */
147
+#endif /* HAVE_6REGS && !defined(BROKEN_RELOCATIONS) */
149 148
 
150 149
 #endif /* AVCODEC_X86_H264_I386_H */
... ...
@@ -227,7 +227,7 @@ section .text
227 227
     imul r2, 0x01010101
228 228
 %endmacro
229 229
 
230
-; I dont know why the sign extension is needed...
230
+; I do not know why the sign extension is needed...
231 231
 %macro PSIGNW_SRA_MMX 2
232 232
     psraw %2, 15
233 233
     PSIGNW_MMX %1, %2
... ...
@@ -272,7 +272,7 @@ static int audio_read_packet(AVFormatContext *context, AVPacket *pkt)
272 272
         }
273 273
     }
274 274
 
275
-    /* Wait for a packet comming back from process_callback(), if one isn't available yet */
275
+    /* Wait for a packet coming back from process_callback(), if one isn't available yet */
276 276
     timeout.tv_sec = av_gettime() / 1000000 + 2;
277 277
     if (sem_timedwait(&self->packet_count, &timeout)) {
278 278
         if (errno == ETIMEDOUT) {
... ...
@@ -72,7 +72,7 @@ TimeFilter * ff_timefilter_new(double clock_period, double feedback2_factor, dou
72 72
  *
73 73
  * system_time, in seconds, should be the value of the system clock time,
74 74
  * at (or as close as possible to) the moment the device hardware interrupt
75
- * occured (or any other event the device clock raises at the beginning of a
75
+ * occurred (or any other event the device clock raises at the beginning of a
76 76
  * cycle).
77 77
  *
78 78
  * @return the filtered time, in seconds
... ...
@@ -28,7 +28,7 @@
28 28
  */
29 29
 
30 30
 #include "libavutil/intreadwrite.h"
31
-#include "libavutil/intfloat_readwrite.h"
31
+#include "libavutil/intfloat.h"
32 32
 #include "avformat.h"
33 33
 #include "internal.h"
34 34
 
... ...
@@ -131,7 +131,7 @@ static int fourxm_read_header(AVFormatContext *s,
131 131
         size = AV_RL32(&header[i + 4]);
132 132
 
133 133
         if (fourcc_tag == std__TAG) {
134
-            fourxm->fps = av_int2flt(AV_RL32(&header[i + 12]));
134
+            fourxm->fps = av_int2float(AV_RL32(&header[i + 12]));
135 135
         } else if (fourcc_tag == vtrk_TAG) {
136 136
             /* check that there is enough data */
137 137
             if (size != vtrk_SIZE) {
... ...
@@ -19,7 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
-#include "libavutil/intfloat_readwrite.h"
22
+#include "libavutil/mathematics.h"
23 23
 #include "libavutil/dict.h"
24 24
 #include "avformat.h"
25 25
 #include "internal.h"
... ...
@@ -90,7 +90,8 @@ static void get_meta(AVFormatContext *s, const char *key, int size)
90 90
 static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec,
91 91
                              int size, unsigned version)
92 92
 {
93
-    AVExtFloat ext;
93
+    int exp;
94
+    uint64_t val;
94 95
     double sample_rate;
95 96
     unsigned int num_frames;
96 97
 
... ...
@@ -101,8 +102,9 @@ static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec,
101 101
     num_frames = avio_rb32(pb);
102 102
     codec->bits_per_coded_sample = avio_rb16(pb);
103 103
 
104
-    avio_read(pb, (uint8_t*)&ext, sizeof(ext));/* Sample rate is in */
105
-    sample_rate = av_ext2dbl(ext);          /* 80 bits BE IEEE extended float */
104
+    exp = avio_rb16(pb);
105
+    val = avio_rb64(pb);
106
+    sample_rate = ldexp(val, exp - 16383 - 63);
106 107
     codec->sample_rate = sample_rate;
107 108
     size -= 18;
108 109
 
... ...
@@ -19,7 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
-#include "libavutil/intfloat_readwrite.h"
22
+#include "libavutil/intfloat.h"
23 23
 #include "avformat.h"
24 24
 #include "internal.h"
25 25
 #include "aiff.h"
... ...
@@ -37,7 +37,7 @@ static int aiff_write_header(AVFormatContext *s)
37 37
     AIFFOutputContext *aiff = s->priv_data;
38 38
     AVIOContext *pb = s->pb;
39 39
     AVCodecContext *enc = s->streams[0]->codec;
40
-    AVExtFloat sample_rate;
40
+    uint64_t sample_rate;
41 41
     int aifc = 0;
42 42
 
43 43
     /* First verify if format is ok */
... ...
@@ -89,8 +89,9 @@ static int aiff_write_header(AVFormatContext *s)
89 89
 
90 90
     avio_wb16(pb, enc->bits_per_coded_sample); /* Sample size */
91 91
 
92
-    sample_rate = av_dbl2ext((double)enc->sample_rate);
93
-    avio_write(pb, (uint8_t*)&sample_rate, sizeof(sample_rate));
92
+    sample_rate = av_double2int(enc->sample_rate);
93
+    avio_wb16(pb, (sample_rate >> 52) + (16383 - 1023));
94
+    avio_wb64(pb, UINT64_C(1) << 63 | sample_rate << 11);
94 95
 
95 96
     if (aifc) {
96 97
         avio_wl32(pb, enc->codec_tag);
... ...
@@ -697,7 +697,8 @@ typedef struct AVStream {
697 697
 
698 698
     /**
699 699
      * last packet in packet_buffer for this stream when muxing.
700
-     * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav*
700
+     * Used internally, NOT PART OF PUBLIC API, do not read or
701
+     * write from outside of libav*
701 702
      */
702 703
     struct AVPacketList *last_in_packet_buffer;
703 704
 #endif
... ...
@@ -731,7 +732,7 @@ typedef struct AVStream {
731 731
     int64_t interleaver_chunk_duration;
732 732
 
733 733
     /**
734
-     * Stream informations used internally by av_find_stream_info()
734
+     * Stream information used internally by av_find_stream_info()
735 735
      */
736 736
 #define MAX_STD_TIMEBASES (60*12+5)
737 737
     struct {
... ...
@@ -909,7 +910,7 @@ typedef struct AVFormatContext {
909 909
     /**
910 910
      * Decoding: duration of the stream, in AV_TIME_BASE fractional
911 911
      * seconds. Only set this value if you know none of the individual stream
912
-     * durations and also dont set any of them. This is deduced from the
912
+     * durations and also do not set any of them. This is deduced from the
913 913
      * AVStream values if not set.
914 914
      */
915 915
     int64_t duration;
... ...
@@ -30,7 +30,7 @@
30 30
 #include "riff.h"
31 31
 #include "isom.h"
32 32
 #include "libavutil/intreadwrite.h"
33
-#include "libavutil/intfloat_readwrite.h"
33
+#include "libavutil/intfloat.h"
34 34
 #include "libavutil/dict.h"
35 35
 #include "caf.h"
36 36
 
... ...
@@ -68,7 +68,7 @@ static int read_desc_chunk(AVFormatContext *s)
68 68
 
69 69
     /* parse format description */
70 70
     st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
71
-    st->codec->sample_rate = av_int2dbl(avio_rb64(pb));
71
+    st->codec->sample_rate = av_int2double(avio_rb64(pb));
72 72
     st->codec->codec_tag   = avio_rl32(pb);
73 73
     flags = avio_rb32(pb);
74 74
     caf->bytes_per_packet  = avio_rb32(pb);
... ...
@@ -20,7 +20,7 @@
20 20
  */
21 21
 
22 22
 #include "libavutil/intreadwrite.h"
23
-#include "libavutil/intfloat_readwrite.h"
23
+#include "libavutil/intfloat.h"
24 24
 #include "avformat.h"
25 25
 #include "internal.h"
26 26
 #include "ffm.h"
... ...
@@ -329,10 +329,10 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
329 329
             codec->rc_max_rate = avio_rb32(pb);
330 330
             codec->rc_min_rate = avio_rb32(pb);
331 331
             codec->rc_buffer_size = avio_rb32(pb);
332
-            codec->i_quant_factor = av_int2dbl(avio_rb64(pb));
333
-            codec->b_quant_factor = av_int2dbl(avio_rb64(pb));
334
-            codec->i_quant_offset = av_int2dbl(avio_rb64(pb));
335
-            codec->b_quant_offset = av_int2dbl(avio_rb64(pb));
332
+            codec->i_quant_factor = av_int2double(avio_rb64(pb));
333
+            codec->b_quant_factor = av_int2double(avio_rb64(pb));
334
+            codec->i_quant_offset = av_int2double(avio_rb64(pb));
335
+            codec->b_quant_offset = av_int2double(avio_rb64(pb));
336 336
             codec->dct_algo = avio_rb32(pb);
337 337
             codec->strict_std_compliance = avio_rb32(pb);
338 338
             codec->max_b_frames = avio_rb32(pb);
... ...
@@ -344,7 +344,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
344 344
             codec->mb_decision = avio_rb32(pb);
345 345
             codec->nsse_weight = avio_rb32(pb);
346 346
             codec->frame_skip_cmp = avio_rb32(pb);
347
-            codec->rc_buffer_aggressivity = av_int2dbl(avio_rb64(pb));
347
+            codec->rc_buffer_aggressivity = av_int2double(avio_rb64(pb));
348 348
             codec->codec_tag = avio_rb32(pb);
349 349
             codec->thread_count = avio_r8(pb);
350 350
             codec->coder_type = avio_rb32(pb);
... ...
@@ -355,8 +355,8 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
355 355
             codec->keyint_min = avio_rb32(pb);
356 356
             codec->scenechange_threshold = avio_rb32(pb);
357 357
             codec->b_frame_strategy = avio_rb32(pb);
358
-            codec->qcompress = av_int2dbl(avio_rb64(pb));
359
-            codec->qblur = av_int2dbl(avio_rb64(pb));
358
+            codec->qcompress = av_int2double(avio_rb64(pb));
359
+            codec->qblur = av_int2double(avio_rb64(pb));
360 360
             codec->max_qdiff = avio_rb32(pb);
361 361
             codec->refs = avio_rb32(pb);
362 362
             codec->directpred = avio_rb32(pb);
... ...
@@ -20,7 +20,7 @@
20 20
  */
21 21
 
22 22
 #include "libavutil/intreadwrite.h"
23
-#include "libavutil/intfloat_readwrite.h"
23
+#include "libavutil/intfloat.h"
24 24
 #include "avformat.h"
25 25
 #include "internal.h"
26 26
 #include "ffm.h"
... ...
@@ -137,10 +137,10 @@ static int ffm_write_header(AVFormatContext *s)
137 137
             avio_wb32(pb, codec->rc_max_rate);
138 138
             avio_wb32(pb, codec->rc_min_rate);
139 139
             avio_wb32(pb, codec->rc_buffer_size);
140
-            avio_wb64(pb, av_dbl2int(codec->i_quant_factor));
141
-            avio_wb64(pb, av_dbl2int(codec->b_quant_factor));
142
-            avio_wb64(pb, av_dbl2int(codec->i_quant_offset));
143
-            avio_wb64(pb, av_dbl2int(codec->b_quant_offset));
140
+            avio_wb64(pb, av_double2int(codec->i_quant_factor));
141
+            avio_wb64(pb, av_double2int(codec->b_quant_factor));
142
+            avio_wb64(pb, av_double2int(codec->i_quant_offset));
143
+            avio_wb64(pb, av_double2int(codec->b_quant_offset));
144 144
             avio_wb32(pb, codec->dct_algo);
145 145
             avio_wb32(pb, codec->strict_std_compliance);
146 146
             avio_wb32(pb, codec->max_b_frames);
... ...
@@ -152,7 +152,7 @@ static int ffm_write_header(AVFormatContext *s)
152 152
             avio_wb32(pb, codec->mb_decision);
153 153
             avio_wb32(pb, codec->nsse_weight);
154 154
             avio_wb32(pb, codec->frame_skip_cmp);
155
-            avio_wb64(pb, av_dbl2int(codec->rc_buffer_aggressivity));
155
+            avio_wb64(pb, av_double2int(codec->rc_buffer_aggressivity));
156 156
             avio_wb32(pb, codec->codec_tag);
157 157
             avio_w8(pb, codec->thread_count);
158 158
             avio_wb32(pb, codec->coder_type);
... ...
@@ -163,8 +163,8 @@ static int ffm_write_header(AVFormatContext *s)
163 163
             avio_wb32(pb, codec->keyint_min);
164 164
             avio_wb32(pb, codec->scenechange_threshold);
165 165
             avio_wb32(pb, codec->b_frame_strategy);
166
-            avio_wb64(pb, av_dbl2int(codec->qcompress));
167
-            avio_wb64(pb, av_dbl2int(codec->qblur));
166
+            avio_wb64(pb, av_double2int(codec->qcompress));
167
+            avio_wb64(pb, av_double2int(codec->qblur));
168 168
             avio_wb32(pb, codec->max_qdiff);
169 169
             avio_wb32(pb, codec->refs);
170 170
             avio_wb32(pb, codec->directpred);
... ...
@@ -26,7 +26,7 @@
26 26
 
27 27
 #include "libavutil/avstring.h"
28 28
 #include "libavutil/dict.h"
29
-#include "libavutil/intfloat_readwrite.h"
29
+#include "libavutil/intfloat.h"
30 30
 #include "libavutil/mathematics.h"
31 31
 #include "libavcodec/bytestream.h"
32 32
 #include "libavcodec/mpeg4audio.h"
... ...
@@ -187,7 +187,7 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream
187 187
         for (i = 0; i < arraylen && avio_tell(ioc) < max_pos - 1; i++) {
188 188
             if (avio_r8(ioc) != AMF_DATA_TYPE_NUMBER)
189 189
                 goto finish;
190
-            current_array[0][i] = av_int2dbl(avio_rb64(ioc));
190
+            current_array[0][i] = av_int2double(avio_rb64(ioc));
191 191
         }
192 192
         if (times && filepositions) {
193 193
             // All done, exiting at a position allowing amf_parse_object
... ...
@@ -224,7 +224,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
224 224
 
225 225
     switch(amf_type) {
226 226
         case AMF_DATA_TYPE_NUMBER:
227
-            num_val = av_int2dbl(avio_rb64(ioc)); break;
227
+            num_val = av_int2double(avio_rb64(ioc)); break;
228 228
         case AMF_DATA_TYPE_BOOL:
229 229
             num_val = avio_r8(ioc); break;
230 230
         case AMF_DATA_TYPE_STRING:
... ...
@@ -20,7 +20,7 @@
20 20
  */
21 21
 
22 22
 #include "libavutil/intreadwrite.h"
23
-#include "libavutil/intfloat_readwrite.h"
23
+#include "libavutil/intfloat.h"
24 24
 #include "avformat.h"
25 25
 #include "flv.h"
26 26
 #include "internal.h"
... ...
@@ -165,7 +165,7 @@ static void put_avc_eos_tag(AVIOContext *pb, unsigned ts) {
165 165
 static void put_amf_double(AVIOContext *pb, double d)
166 166
 {
167 167
     avio_w8(pb, AMF_DATA_TYPE_NUMBER);
168
-    avio_wb64(pb, av_dbl2int(d));
168
+    avio_wb64(pb, av_double2int(d));
169 169
 }
170 170
 
171 171
 static void put_amf_bool(AVIOContext *pb, int b) {
... ...
@@ -380,7 +380,7 @@ static int flv_write_trailer(AVFormatContext *s)
380 380
 
381 381
     file_size = avio_tell(pb);
382 382
 
383
-    /* update informations */
383
+    /* update information */
384 384
     avio_seek(pb, flv->duration_offset, SEEK_SET);
385 385
     put_amf_double(pb, flv->duration / (double)1000);
386 386
     avio_seek(pb, flv->filesize_offset, SEEK_SET);
... ...
@@ -19,7 +19,7 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
-#include "libavutil/intfloat_readwrite.h"
22
+#include "libavutil/intfloat.h"
23 23
 #include "libavutil/opt.h"
24 24
 #include "libavutil/mathematics.h"
25 25
 #include "libavcodec/timecode.h"
... ...
@@ -551,8 +551,8 @@ static int gxf_write_umf_media_dv(AVIOContext *pb, GXFStreamContext *sc)
551 551
 
552 552
 static int gxf_write_umf_media_audio(AVIOContext *pb, GXFStreamContext *sc)
553 553
 {
554
-    avio_wl64(pb, av_dbl2int(1)); /* sound level to begin to */
555
-    avio_wl64(pb, av_dbl2int(1)); /* sound level to begin to */
554
+    avio_wl64(pb, av_double2int(1)); /* sound level to begin to */
555
+    avio_wl64(pb, av_double2int(1)); /* sound level to begin to */
556 556
     avio_wl32(pb, 0); /* number of fields over which to ramp up sound level */
557 557
     avio_wl32(pb, 0); /* number of fields over which to ramp down sound level */
558 558
     avio_wl32(pb, 0); /* reserved */
... ...
@@ -70,7 +70,7 @@ static const AVClass flavor ## _context_class = {\
70 70
     .item_name      = av_default_item_name,\
71 71
     .option         = options,\
72 72
     .version        = LIBAVUTIL_VERSION_INT,\
73
-};
73
+}
74 74
 
75 75
 HTTP_CLASS(http);
76 76
 HTTP_CLASS(https);
... ...
@@ -149,7 +149,7 @@ static void free_geobtag(void *obj)
149 149
  * @param maxread Pointer to maximum number of characters to read from the
150 150
  * AVIOContext. After execution the value is decremented by the number of bytes
151 151
  * actually read.
152
- * @returns 0 if no error occured, dst is uninitialized on error
152
+ * @returns 0 if no error occurred, dst is uninitialized on error
153 153
  */
154 154
 static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
155 155
                       uint8_t **dst, int *maxread)
... ...
@@ -446,7 +446,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
446 446
                      (!st->codec->extradata_size &&
447 447
                       AV_RL32(pkt->data+4) != MKTAG('j','P',' ',' '))){ // signature
448 448
             error:
449
-                av_log(s, AV_LOG_ERROR, "malformated jpeg2000 codestream %X\n", AV_RB32(pkt->data));
449
+                av_log(s, AV_LOG_ERROR, "malformed JPEG 2000 codestream %X\n", AV_RB32(pkt->data));
450 450
                 return -1;
451 451
             }
452 452
         }
... ...
@@ -24,7 +24,7 @@
24 24
 
25 25
 static int probe(AVProbeData *p)
26 26
 {
27
-    // the single file i have starts with that, i dont know if others do too
27
+    // the single file I have starts with that, I do not know if others do, too
28 28
     if(   p->buf[0] == 1
29 29
        && p->buf[1] == 1
30 30
        && p->buf[2] == 3
... ...
@@ -38,7 +38,7 @@
38 38
 #include "rm.h"
39 39
 #include "matroska.h"
40 40
 #include "libavcodec/mpeg4audio.h"
41
-#include "libavutil/intfloat_readwrite.h"
41
+#include "libavutil/intfloat.h"
42 42
 #include "libavutil/intreadwrite.h"
43 43
 #include "libavutil/avstring.h"
44 44
 #include "libavutil/lzo.h"
... ...
@@ -652,9 +652,9 @@ static int ebml_read_float(AVIOContext *pb, int size, double *num)
652 652
     if (size == 0) {
653 653
         *num = 0;
654 654
     } else if (size == 4) {
655
-        *num= av_int2flt(avio_rb32(pb));
656
-    } else if(size==8){
657
-        *num= av_int2dbl(avio_rb64(pb));
655
+        *num = av_int2float(avio_rb32(pb));
656
+    } else if (size == 8){
657
+        *num = av_int2double(avio_rb64(pb));
658 658
     } else
659 659
         return AVERROR_INVALIDDATA;
660 660
 
... ...
@@ -29,7 +29,7 @@
29 29
 #include "avlanguage.h"
30 30
 #include "libavutil/samplefmt.h"
31 31
 #include "libavutil/intreadwrite.h"
32
-#include "libavutil/intfloat_readwrite.h"
32
+#include "libavutil/intfloat.h"
33 33
 #include "libavutil/mathematics.h"
34 34
 #include "libavutil/random_seed.h"
35 35
 #include "libavutil/lfg.h"
... ...
@@ -185,7 +185,7 @@ static void put_ebml_float(AVIOContext *pb, unsigned int elementid, double val)
185 185
 {
186 186
     put_ebml_id(pb, elementid);
187 187
     put_ebml_num(pb, 8, 0);
188
-    avio_wb64(pb, av_dbl2int(val));
188
+    avio_wb64(pb, av_double2int(val));
189 189
 }
190 190
 
191 191
 static void put_ebml_binary(AVIOContext *pb, unsigned int elementid,
... ...
@@ -33,7 +33,7 @@ typedef struct {
33 33
 
34 34
     /** Buffer for outgoing packets. */
35 35
     /*@{*/
36
-    uint8_t *write_out_ptr;              ///< Pointer for writting the buffer.
36
+    uint8_t *write_out_ptr;              ///< Pointer for writing the buffer.
37 37
     uint8_t out_buffer[512];            ///< Buffer for outgoing packet.
38 38
     /*@}*/
39 39
 
... ...
@@ -26,7 +26,7 @@
26 26
 //#define MOV_EXPORT_ALL_METADATA
27 27
 
28 28
 #include "libavutil/intreadwrite.h"
29
-#include "libavutil/intfloat_readwrite.h"
29
+#include "libavutil/intfloat.h"
30 30
 #include "libavutil/mathematics.h"
31 31
 #include "libavutil/avstring.h"
32 32
 #include "libavutil/dict.h"
... ...
@@ -1261,7 +1261,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
1261 1261
                     avio_rb32(pb); /* bytes per sample */
1262 1262
                 } else if (version==2) {
1263 1263
                     avio_rb32(pb); /* sizeof struct only */
1264
-                    st->codec->sample_rate = av_int2dbl(avio_rb64(pb)); /* float 64 */
1264
+                    st->codec->sample_rate = av_int2double(avio_rb64(pb)); /* float 64 */
1265 1265
                     st->codec->channels = avio_rb32(pb);
1266 1266
                     avio_rb32(pb); /* always 0x7F000000 */
1267 1267
                     st->codec->bits_per_coded_sample = avio_rb32(pb); /* bits per channel if sound is uncompressed */
... ...
@@ -32,7 +32,7 @@
32 32
 #include "libavcodec/put_bits.h"
33 33
 #include "internal.h"
34 34
 #include "libavutil/avstring.h"
35
-#include "libavutil/intfloat_readwrite.h"
35
+#include "libavutil/intfloat.h"
36 36
 #include "libavutil/mathematics.h"
37 37
 #include "libavutil/opt.h"
38 38
 #include "libavutil/dict.h"
... ...
@@ -250,7 +250,7 @@ static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track)
250 250
 
251 251
 /**
252 252
  * This function writes extradata "as is".
253
- * Extradata must be formated like a valid atom (with size and tag)
253
+ * Extradata must be formatted like a valid atom (with size and tag).
254 254
  */
255 255
 static int mov_write_extradata_tag(AVIOContext *pb, MOVTrack *track)
256 256
 {
... ...
@@ -484,7 +484,7 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
484 484
         avio_wb16(pb, 0);
485 485
         avio_wb32(pb, 0x00010000);
486 486
         avio_wb32(pb, 72);
487
-        avio_wb64(pb, av_dbl2int(track->timescale));
487
+        avio_wb64(pb, av_double2int(track->timescale));
488 488
         avio_wb32(pb, track->enc->channels);
489 489
         avio_wb32(pb, 0x7F000000);
490 490
         avio_wb32(pb, av_get_bits_per_sample(track->enc->codec_id));
... ...
@@ -1302,7 +1302,7 @@ static int mov_write_tapt_tag(AVIOContext *pb, MOVTrack *track)
1302 1302
     avio_wb32(pb, track->enc->height << 16);
1303 1303
 
1304 1304
     return updateSize(pb, pos);
1305
-};
1305
+}
1306 1306
 
1307 1307
 // This box seems important for the psp playback ... without it the movie seems to hang
1308 1308
 static int mov_write_edts_tag(AVIOContext *pb, MOVTrack *track)
... ...
@@ -2206,6 +2206,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
2206 2206
     AVCodecContext *enc = trk->enc;
2207 2207
     unsigned int samplesInChunk = 0;
2208 2208
     int size= pkt->size;
2209
+    uint8_t *reformatted_data = NULL;
2209 2210
 
2210 2211
     if (!s->pb->seekable) return 0; /* Can't handle that */
2211 2212
     if (!size) return 0; /* Discard 0 sized packets */
... ...
@@ -2255,13 +2256,23 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
2255 2255
         if(mov->frag_seq_num>0){
2256 2256
             uint8_t *buf=NULL;
2257 2257
             size= pkt->size;
2258
+
2258 2259
             if(ff_avc_parse_nal_units_buf(pkt->data, &buf, &size) < 0){
2259 2260
                 av_log(s, AV_LOG_ERROR, "malformated H264 bitstream\n");
2260 2261
                 return -1;
2261 2262
             }
2262 2263
             trk->cluster[trk->entry].data= buf;
2263
-        }else
2264
+            if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) {
2265
+                reformatted_data= av_malloc(size);
2266
+                memcpy(reformatted_data, buf, size);
2267
+            }
2268
+        }else if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) {
2269
+            ff_avc_parse_nal_units_buf(pkt->data, &reformatted_data,
2270
+                                       &size);
2271
+            avio_write(pb, reformatted_data, size);
2272
+        } else {
2264 2273
             size = ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
2274
+        }
2265 2275
     } else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 &&
2266 2276
                (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
2267 2277
         av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
... ...
@@ -2320,7 +2331,9 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
2320 2320
     avio_flush(pb);
2321 2321
 
2322 2322
     if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams)
2323
-        ff_mov_add_hinted_packet(s, pkt, trk->hint_track, trk->entry);
2323
+        ff_mov_add_hinted_packet(s, pkt, trk->hint_track, trk->entry,
2324
+                                 reformatted_data, size);
2325
+    av_free(reformatted_data);
2324 2326
     return 0;
2325 2327
 }
2326 2328
 
... ...
@@ -131,7 +131,8 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt);
131 131
 
132 132
 int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index);
133 133
 int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
134
-                             int track_index, int sample);
134
+                             int track_index, int sample,
135
+                             uint8_t *sample_data, int sample_size);
135 136
 void ff_mov_close_hinting(MOVTrack *track);
136 137
 
137 138
 #endif /* AVFORMAT_MOVENC_H */
... ...
@@ -95,11 +95,12 @@ static void sample_queue_free(HintSampleQueue *queue)
95 95
  * not copied. sample_queue_retain should be called before pkt->data
96 96
  * is reused/freed.
97 97
  */
98
-static void sample_queue_push(HintSampleQueue *queue, AVPacket *pkt, int sample)
98
+static void sample_queue_push(HintSampleQueue *queue, uint8_t *data, int size,
99
+                              int sample)
99 100
 {
100 101
     /* No need to keep track of smaller samples, since describing them
101 102
      * with immediates is more efficient. */
102
-    if (pkt->size <= 14)
103
+    if (size <= 14)
103 104
         return;
104 105
     if (!queue->samples || queue->len >= queue->size) {
105 106
         HintSample* samples;
... ...
@@ -109,8 +110,8 @@ static void sample_queue_push(HintSampleQueue *queue, AVPacket *pkt, int sample)
109 109
             return;
110 110
         queue->samples = samples;
111 111
     }
112
-    queue->samples[queue->len].data = pkt->data;
113
-    queue->samples[queue->len].size = pkt->size;
112
+    queue->samples[queue->len].data = data;
113
+    queue->samples[queue->len].size = size;
114 114
     queue->samples[queue->len].sample_number = sample;
115 115
     queue->samples[queue->len].offset = 0;
116 116
     queue->samples[queue->len].own_data = 0;
... ...
@@ -386,7 +387,8 @@ static int write_hint_packets(AVIOContext *out, const uint8_t *data,
386 386
 }
387 387
 
388 388
 int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
389
-                             int track_index, int sample)
389
+                             int track_index, int sample,
390
+                             uint8_t *sample_data, int sample_size)
390 391
 {
391 392
     MOVMuxContext *mov = s->priv_data;
392 393
     MOVTrack *trk = &mov->tracks[track_index];
... ...
@@ -402,7 +404,10 @@ int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
402 402
     if (!rtp_ctx->pb)
403 403
         return AVERROR(ENOMEM);
404 404
 
405
-    sample_queue_push(&trk->sample_queue, pkt, sample);
405
+    if (sample_data)
406
+        sample_queue_push(&trk->sample_queue, sample_data, sample_size, sample);
407
+    else
408
+        sample_queue_push(&trk->sample_queue, pkt->data, pkt->size, sample);
406 409
 
407 410
     /* Feed the packet to the RTP muxer */
408 411
     ff_write_chained(rtp_ctx, 0, pkt, s);
... ...
@@ -1939,7 +1939,7 @@ static int mpegts_read_header(AVFormatContext *s,
1939 1939
     if (s->iformat == &ff_mpegts_demuxer) {
1940 1940
         /* normal demux */
1941 1941
 
1942
-        /* first do a scanning to get all the services */
1942
+        /* first do a scan to get all the services */
1943 1943
         /* NOTE: We attempt to seek on non-seekable files as well, as the
1944 1944
          * probe buffer usually is big enough. Only warn if the seek failed
1945 1945
          * on files where the seek should work. */
... ...
@@ -979,7 +979,7 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
979 979
         uint32_t state = -1;
980 980
 
981 981
         if (pkt->size < 5 || AV_RB32(pkt->data) != 0x0000001) {
982
-            av_log(s, AV_LOG_ERROR, "h264 bitstream malformated, "
982
+            av_log(s, AV_LOG_ERROR, "H.264 bitstream malformed, "
983 983
                    "no startcode found, use -vbsf h264_mp4toannexb\n");
984 984
             return -1;
985 985
         }
... ...
@@ -70,7 +70,7 @@ typedef struct {
70 70
     int index;               ///< index in mxf_essence_container_uls table
71 71
     const UID *codec_ul;
72 72
     int order;               ///< interleaving order if dts are equal
73
-    int interlaced;          ///< wether picture is interlaced
73
+    int interlaced;          ///< whether picture is interlaced
74 74
     int temporal_reordering;
75 75
     AVRational aspect_ratio; ///< display aspect ratio
76 76
     int closed_gop;          ///< gop is closed, used in mpeg-2 frame parsing
... ...
@@ -20,7 +20,7 @@
20 20
  */
21 21
 
22 22
 #include "libavutil/intreadwrite.h"
23
-#include "libavutil/intfloat_readwrite.h"
23
+#include "libavutil/intfloat.h"
24 24
 #include "avformat.h"
25 25
 #include "internal.h"
26 26
 #include "riff.h"
... ...
@@ -140,10 +140,10 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
140 140
     avio_rl32(pb); // unused, "desiredheight"
141 141
     avio_r8(pb); // 'P' == progressive, 'I' == interlaced
142 142
     avio_skip(pb, 3); // padding
143
-    aspect = av_int2dbl(avio_rl64(pb));
143
+    aspect = av_int2double(avio_rl64(pb));
144 144
     if (aspect > 0.9999 && aspect < 1.0001)
145 145
         aspect = 4.0 / 3.0;
146
-    fps = av_int2dbl(avio_rl64(pb));
146
+    fps = av_int2double(avio_rl64(pb));
147 147
 
148 148
     // number of packets per stream type, -1 means unknown, e.g. streaming
149 149
     v_packs = avio_rl32(pb);
... ...
@@ -484,7 +484,7 @@ real_parse_asm_rulebook(AVFormatContext *s, AVStream *orig_st,
484 484
      * is set and once for if it isn't. We only read the first because we
485 485
      * don't care much (that's what the "odd" variable is for).
486 486
      * Each rule contains a set of one or more statements, optionally
487
-     * preceeded by a single condition. If there's a condition, the rule
487
+     * preceded by a single condition. If there's a condition, the rule
488 488
      * starts with a '#'. Multiple conditions are merged between brackets,
489 489
      * so there are never multiple conditions spread out over separate
490 490
      * statements. Generally, these conditions are bitrate limits (min/max)
... ...
@@ -21,7 +21,7 @@
21 21
 
22 22
 #include "libavcodec/bytestream.h"
23 23
 #include "libavutil/avstring.h"
24
-#include "libavutil/intfloat_readwrite.h"
24
+#include "libavutil/intfloat.h"
25 25
 #include "avformat.h"
26 26
 
27 27
 #include "rtmppkt.h"
... ...
@@ -37,7 +37,7 @@ void ff_amf_write_bool(uint8_t **dst, int val)
37 37
 void ff_amf_write_number(uint8_t **dst, double val)
38 38
 {
39 39
     bytestream_put_byte(dst, AMF_DATA_TYPE_NUMBER);
40
-    bytestream_put_be64(dst, av_dbl2int(val));
40
+    bytestream_put_be64(dst, av_double2int(val));
41 41
 }
42 42
 
43 43
 void ff_amf_write_string(uint8_t **dst, const char *str)
... ...
@@ -318,7 +318,7 @@ int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
318 318
         if (size == namelen && !memcmp(data-size, name, namelen)) {
319 319
             switch (*data++) {
320 320
             case AMF_DATA_TYPE_NUMBER:
321
-                snprintf(dst, dst_size, "%g", av_int2dbl(AV_RB64(data)));
321
+                snprintf(dst, dst_size, "%g", av_int2double(AV_RB64(data)));
322 322
                 break;
323 323
             case AMF_DATA_TYPE_BOOL:
324 324
                 snprintf(dst, dst_size, "%s", *data ? "true" : "false");
... ...
@@ -370,7 +370,7 @@ static void ff_amf_tag_contents(void *ctx, const uint8_t *data, const uint8_t *d
370 370
         return;
371 371
     switch (*data++) {
372 372
     case AMF_DATA_TYPE_NUMBER:
373
-        av_log(ctx, AV_LOG_DEBUG, " number %g\n", av_int2dbl(AV_RB64(data)));
373
+        av_log(ctx, AV_LOG_DEBUG, " number %g\n", av_int2double(AV_RB64(data)));
374 374
         return;
375 375
     case AMF_DATA_TYPE_BOOL:
376 376
         av_log(ctx, AV_LOG_DEBUG, " bool %d\n", *data);
... ...
@@ -26,7 +26,7 @@
26 26
 
27 27
 #include "libavcodec/bytestream.h"
28 28
 #include "libavutil/avstring.h"
29
-#include "libavutil/intfloat_readwrite.h"
29
+#include "libavutil/intfloat.h"
30 30
 #include "libavutil/lfg.h"
31 31
 #include "libavutil/sha.h"
32 32
 #include "avformat.h"
... ...
@@ -615,7 +615,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
615 615
                 /* hack for Wowza Media Server, it does not send result for
616 616
                  * releaseStream and FCPublish calls */
617 617
                 if (!pkt->data[10]) {
618
-                    int pkt_id = (int) av_int2dbl(AV_RB64(pkt->data + 11));
618
+                    int pkt_id = av_int2double(AV_RB64(pkt->data + 11));
619 619
                     if (pkt_id == rt->create_stream_invoke)
620 620
                         rt->state = STATE_CONNECTING;
621 621
                 }
... ...
@@ -626,7 +626,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
626 626
                 if (pkt->data[10] || pkt->data[19] != 5 || pkt->data[20]) {
627 627
                     av_log(s, AV_LOG_WARNING, "Unexpected reply on connect()\n");
628 628
                 } else {
629
-                    rt->main_channel_id = (int) av_int2dbl(AV_RB64(pkt->data + 21));
629
+                    rt->main_channel_id = av_int2double(AV_RB64(pkt->data + 21));
630 630
                 }
631 631
                 if (rt->is_input) {
632 632
                     gen_play(s, rt);
... ...
@@ -72,7 +72,7 @@ enum CodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type);
72 72
 #define RTP_VERSION 2
73 73
 #define RTP_MAX_SDES 256   /**< maximum text length for SDES */
74 74
 
75
-/* RTCP paquets use 0.5 % of the bandwidth */
75
+/* RTCP packets use 0.5% of the bandwidth */
76 76
 #define RTCP_TX_RATIO_NUM 5
77 77
 #define RTCP_TX_RATIO_DEN 1000
78 78
 
... ...
@@ -33,18 +33,15 @@ static const uint8_t *avc_mp4_find_startcode(const uint8_t *start, const uint8_t
33 33
 {
34 34
     int res = 0;
35 35
 
36
-    if (end - start < nal_length_size) {
36
+    if (end - start < nal_length_size)
37 37
         return NULL;
38
-    }
39
-    while (nal_length_size--) {
38
+    while (nal_length_size--)
40 39
         res = (res << 8) | *start++;
41
-    }
42 40
 
43
-    if (end - start < res) {
41
+    if (start + res > end || res < 0 || start + res < start)
44 42
         return NULL;
45
-    }
46 43
 
47
-    return res + start;
44
+    return start + res;
48 45
 }
49 46
 
50 47
 static void nal_send(AVFormatContext *s1, const uint8_t *buf, int size, int last)
... ...
@@ -80,25 +77,27 @@ static void nal_send(AVFormatContext *s1, const uint8_t *buf, int size, int last
80 80
 
81 81
 void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size)
82 82
 {
83
-    const uint8_t *r;
83
+    const uint8_t *r, *end = buf1 + size;
84 84
     RTPMuxContext *s = s1->priv_data;
85 85
 
86 86
     s->timestamp = s->cur_timestamp;
87
-    r = s->nal_length_size ? (avc_mp4_find_startcode(buf1, buf1 + size, s->nal_length_size) ? buf1 : buf1 + size) : ff_avc_find_startcode(buf1, buf1 + size);
88
-    while (r < buf1 + size) {
87
+    if (s->nal_length_size)
88
+        r = avc_mp4_find_startcode(buf1, end, s->nal_length_size) ? buf1 : end;
89
+    else
90
+        r = ff_avc_find_startcode(buf1, end);
91
+    while (r < end) {
89 92
         const uint8_t *r1;
90 93
 
91 94
         if (s->nal_length_size) {
92
-            r1 = avc_mp4_find_startcode(r, buf1 + size, s->nal_length_size);
93
-            if (!r1) {
94
-                r1 = buf1 + size;
95
-            }
95
+            r1 = avc_mp4_find_startcode(r, end, s->nal_length_size);
96
+            if (!r1)
97
+                r1 = end;
96 98
             r += s->nal_length_size;
97 99
         } else {
98
-            while(!*(r++));
99
-            r1 = ff_avc_find_startcode(r, buf1 + size);
100
+            while (!*(r++));
101
+            r1 = ff_avc_find_startcode(r, end);
100 102
         }
101
-        nal_send(s1, r, r1 - r, (r1 == buf1 + size));
103
+        nal_send(s1, r, r1 - r, r1 == end);
102 104
         r = r1;
103 105
     }
104 106
 }
... ...
@@ -156,6 +156,8 @@ static char *extradata2psets(AVCodecContext *c)
156 156
     char *psets, *p;
157 157
     const uint8_t *r;
158 158
     const char *pset_string = "; sprop-parameter-sets=";
159
+    uint8_t *orig_extradata = NULL;
160
+    int orig_extradata_size = 0;
159 161
 
160 162
     if (c->extradata_size > MAX_EXTRADATA_SIZE) {
161 163
         av_log(c, AV_LOG_ERROR, "Too much extradata!\n");
... ...
@@ -172,6 +174,15 @@ static char *extradata2psets(AVCodecContext *c)
172 172
 
173 173
             return NULL;
174 174
         }
175
+
176
+        orig_extradata_size = c->extradata_size;
177
+        orig_extradata = av_mallocz(orig_extradata_size +
178
+                                    FF_INPUT_BUFFER_PADDING_SIZE);
179
+        if (!orig_extradata) {
180
+            av_bitstream_filter_close(bsfc);
181
+            return NULL;
182
+        }
183
+        memcpy(orig_extradata, c->extradata, orig_extradata_size);
175 184
         av_bitstream_filter_filter(bsfc, c, NULL, &dummy_p, &dummy_int, NULL, 0, 0);
176 185
         av_bitstream_filter_close(bsfc);
177 186
     }
... ...
@@ -179,6 +190,7 @@ static char *extradata2psets(AVCodecContext *c)
179 179
     psets = av_mallocz(MAX_PSET_SIZE);
180 180
     if (psets == NULL) {
181 181
         av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the parameter sets.\n");
182
+        av_free(orig_extradata);
182 183
         return NULL;
183 184
     }
184 185
     memcpy(psets, pset_string, strlen(pset_string));
... ...
@@ -208,6 +220,11 @@ static char *extradata2psets(AVCodecContext *c)
208 208
         p += strlen(p);
209 209
         r = r1;
210 210
     }
211
+    if (orig_extradata) {
212
+        av_free(c->extradata);
213
+        c->extradata      = orig_extradata;
214
+        c->extradata_size = orig_extradata_size;
215
+    }
211 216
 
212 217
     return psets;
213 218
 }
... ...
@@ -30,7 +30,7 @@
30 30
  */
31 31
 
32 32
 #include "libavutil/intreadwrite.h"
33
-#include "libavutil/intfloat_readwrite.h"
33
+#include "libavutil/intfloat.h"
34 34
 #include "libavutil/dict.h"
35 35
 #include "avformat.h"
36 36
 #include "internal.h"
... ...
@@ -62,14 +62,14 @@ static int sox_read_header(AVFormatContext *s,
62 62
         st->codec->codec_id = CODEC_ID_PCM_S32LE;
63 63
         header_size         = avio_rl32(pb);
64 64
         avio_skip(pb, 8); /* sample count */
65
-        sample_rate         = av_int2dbl(avio_rl64(pb));
65
+        sample_rate         = av_int2double(avio_rl64(pb));
66 66
         st->codec->channels = avio_rl32(pb);
67 67
         comment_size        = avio_rl32(pb);
68 68
     } else {
69 69
         st->codec->codec_id = CODEC_ID_PCM_S32BE;
70 70
         header_size         = avio_rb32(pb);
71 71
         avio_skip(pb, 8); /* sample count */
72
-        sample_rate         = av_int2dbl(avio_rb64(pb));
72
+        sample_rate         = av_int2double(avio_rb64(pb));
73 73
         st->codec->channels = avio_rb32(pb);
74 74
         comment_size        = avio_rb32(pb);
75 75
     }
... ...
@@ -30,7 +30,7 @@
30 30
  */
31 31
 
32 32
 #include "libavutil/intreadwrite.h"
33
-#include "libavutil/intfloat_readwrite.h"
33
+#include "libavutil/intfloat.h"
34 34
 #include "libavutil/dict.h"
35 35
 #include "avformat.h"
36 36
 #include "avio_internal.h"
... ...
@@ -59,14 +59,14 @@ static int sox_write_header(AVFormatContext *s)
59 59
         ffio_wfourcc(pb, ".SoX");
60 60
         avio_wl32(pb, sox->header_size);
61 61
         avio_wl64(pb, 0); /* number of samples */
62
-        avio_wl64(pb, av_dbl2int(enc->sample_rate));
62
+        avio_wl64(pb, av_double2int(enc->sample_rate));
63 63
         avio_wl32(pb, enc->channels);
64 64
         avio_wl32(pb, comment_size);
65 65
     } else if (enc->codec_id == CODEC_ID_PCM_S32BE) {
66 66
         ffio_wfourcc(pb, "XoS.");
67 67
         avio_wb32(pb, sox->header_size);
68 68
         avio_wb64(pb, 0); /* number of samples */
69
-        avio_wb64(pb, av_dbl2int(enc->sample_rate));
69
+        avio_wb64(pb, av_double2int(enc->sample_rate));
70 70
         avio_wb32(pb, enc->channels);
71 71
         avio_wb32(pb, comment_size);
72 72
     } else {
... ...
@@ -20,7 +20,7 @@
20 20
  */
21 21
 
22 22
 #include "libavutil/intreadwrite.h"
23
-#include "libavutil/intfloat_readwrite.h"
23
+#include "libavutil/intfloat.h"
24 24
 #include "avformat.h"
25 25
 #include "internal.h"
26 26
 
... ...
@@ -69,7 +69,7 @@ static int thp_read_header(AVFormatContext *s,
69 69
                            avio_rb32(pb); /* Max buf size.  */
70 70
                            avio_rb32(pb); /* Max samples.  */
71 71
 
72
-    thp->fps             = av_d2q(av_int2flt(avio_rb32(pb)), INT_MAX);
72
+    thp->fps             = av_d2q(av_int2float(avio_rb32(pb)), INT_MAX);
73 73
     thp->framecnt        = avio_rb32(pb);
74 74
     thp->first_framesz   = avio_rb32(pb);
75 75
                            avio_rb32(pb); /* Data size.  */
... ...
@@ -452,7 +452,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
452 452
         goto fail;
453 453
 
454 454
     /* Follow the requested reuse option, unless it's multicast in which
455
-     * case enable reuse unless explicitely disabled.
455
+     * case enable reuse unless explicitly disabled.
456 456
      */
457 457
     if (s->reuse_socket || (s->is_multicast && !reuse_specified)) {
458 458
         s->reuse_socket = 1;
... ...
@@ -1123,7 +1123,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
1123 1123
             FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i+1]);
1124 1124
         if(pkt->dts == AV_NOPTS_VALUE)
1125 1125
             pkt->dts= st->pts_buffer[0];
1126
-        if(st->codec->codec_id == CODEC_ID_H264){ //we skiped it above so we try here
1126
+        if(st->codec->codec_id == CODEC_ID_H264){ // we skipped it above so we try here
1127 1127
             update_initial_timestamps(s, pkt->stream_index, pkt->dts, pkt->pts); // this should happen on the first packet
1128 1128
         }
1129 1129
         if(pkt->dts > st->cur_dts)
... ...
@@ -58,7 +58,7 @@ int av_expr_parse_and_eval(double *res, const char *s,
58 58
  * Parse an expression.
59 59
  *
60 60
  * @param expr a pointer where is put an AVExpr containing the parsed
61
- * value in case of successfull parsing, or NULL otherwise.
61
+ * value in case of successful parsing, or NULL otherwise.
62 62
  * The pointed to AVExpr must be freed with av_expr_free() by the user
63 63
  * when it is not needed anymore.
64 64
  * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
65 65
new file mode 100644
... ...
@@ -0,0 +1,73 @@
0
+/*
1
+ * Copyright (c) 2011 Mans Rullgard
2
+ *
3
+ * This file is part of Libav.
4
+ *
5
+ * Libav is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * Libav is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with Libav; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+ */
19
+
20
+#ifndef AVUTIL_INTFLOAT_H
21
+#define AVUTIL_INTFLOAT_H
22
+
23
+#include <stdint.h>
24
+#include "attributes.h"
25
+
26
+union av_intfloat32 {
27
+    uint32_t i;
28
+    float    f;
29
+};
30
+
31
+union av_intfloat64 {
32
+    uint64_t i;
33
+    double   f;
34
+};
35
+
36
+/**
37
+ * Reinterpret a 32-bit integer as a float.
38
+ */
39
+static av_always_inline float av_int2float(uint32_t i)
40
+{
41
+    union av_intfloat32 v = { .i = i };
42
+    return v.f;
43
+}
44
+
45
+/**
46
+ * Reinterpret a float as a 32-bit integer.
47
+ */
48
+static av_always_inline uint32_t av_float2int(float f)
49
+{
50
+    union av_intfloat32 v = { .f = f };
51
+    return v.i;
52
+}
53
+
54
+/**
55
+ * Reinterpret a 64-bit integer as a double.
56
+ */
57
+static av_always_inline double av_int2double(uint64_t i)
58
+{
59
+    union av_intfloat64 v = { .i = i };
60
+    return v.f;
61
+}
62
+
63
+/**
64
+ * Reinterpret a double as a 64-bit integer.
65
+ */
66
+static av_always_inline uint64_t av_double2int(double f)
67
+{
68
+    union av_intfloat64 v = { .f = f };
69
+    return v.i;
70
+}
71
+
72
+#endif /* AVUTIL_INTFLOAT_H */
... ...
@@ -30,11 +30,11 @@ typedef struct AVExtFloat  {
30 30
     uint8_t mantissa[8];
31 31
 } AVExtFloat;
32 32
 
33
-double av_int2dbl(int64_t v) av_const;
34
-float av_int2flt(int32_t v) av_const;
35
-double av_ext2dbl(const AVExtFloat ext) av_const;
36
-int64_t av_dbl2int(double d) av_const;
37
-int32_t av_flt2int(float d) av_const;
38
-AVExtFloat av_dbl2ext(double d) av_const;
33
+attribute_deprecated double av_int2dbl(int64_t v) av_const;
34
+attribute_deprecated float av_int2flt(int32_t v) av_const;
35
+attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const;
36
+attribute_deprecated int64_t av_dbl2int(double d) av_const;
37
+attribute_deprecated int32_t av_flt2int(float d) av_const;
38
+attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const;
39 39
 
40 40
 #endif /* AVUTIL_INTFLOAT_READWRITE_H */
... ...
@@ -912,7 +912,7 @@ static void reallocBuffers(PPContext *c, int width, int height, int stride, int
912 912
             c->yHistogram[i]= width*height/64*15/256;
913 913
 
914 914
     for(i=0; i<3; i++){
915
-        //Note: The +17*1024 is just there so i do not have to worry about r/w over the end.
915
+        //Note: The +17*1024 is just there so I do not have to worry about r/w over the end.
916 916
         reallocAlign((void **)&c->tempBlurred[i], 8, stride*mbHeight*16 + 17*1024);
917 917
         reallocAlign((void **)&c->tempBlurredPast[i], 8, 256*((height+7)&(~7))/2 + 17*1024);//FIXME size
918 918
     }
... ...
@@ -100,7 +100,7 @@ typedef struct PPMode{
100 100
 
101 101
     int minAllowedY;                ///< for brigtness correction
102 102
     int maxAllowedY;                ///< for brihtness correction
103
-    float maxClippedThreshold;      ///< amount of "black" u r willing to loose to get a brightness corrected picture
103
+    float maxClippedThreshold;      ///< amount of "black" you are willing to lose to get a brightness-corrected picture
104 104
 
105 105
     int maxTmpNoise[3];             ///< for Temporal Noise Reducing filter (Maximal sum of abs differences)
106 106
 
... ...
@@ -310,8 +310,8 @@ void shuffle_bytes_##a##b##c##d(const uint8_t *src, uint8_t *dst, int src_size)
310 310
     }                                                                   \
311 311
 }
312 312
 
313
-DEFINE_SHUFFLE_BYTES(0, 3, 2, 1);
314
-DEFINE_SHUFFLE_BYTES(1, 2, 3, 0);
315
-DEFINE_SHUFFLE_BYTES(3, 0, 1, 2);
316
-DEFINE_SHUFFLE_BYTES(3, 2, 1, 0);
313
+DEFINE_SHUFFLE_BYTES(0, 3, 2, 1)
314
+DEFINE_SHUFFLE_BYTES(1, 2, 3, 0)
315
+DEFINE_SHUFFLE_BYTES(3, 0, 1, 2)
316
+DEFINE_SHUFFLE_BYTES(3, 2, 1, 0)
317 317
 
... ...
@@ -396,12 +396,12 @@ static void yuv2planeX_ ## bits ## BE_LE ## _c(const int16_t *filter, int filter
396 396
                          filterSize, (const typeX_t **) src, \
397 397
                          (uint16_t *) dest, dstW, is_be, bits); \
398 398
 }
399
-yuv2NBPS( 9, BE, 1, 10, int16_t);
400
-yuv2NBPS( 9, LE, 0, 10, int16_t);
401
-yuv2NBPS(10, BE, 1, 10, int16_t);
402
-yuv2NBPS(10, LE, 0, 10, int16_t);
403
-yuv2NBPS(16, BE, 1, 16, int32_t);
404
-yuv2NBPS(16, LE, 0, 16, int32_t);
399
+yuv2NBPS( 9, BE, 1, 10, int16_t)
400
+yuv2NBPS( 9, LE, 0, 10, int16_t)
401
+yuv2NBPS(10, BE, 1, 10, int16_t)
402
+yuv2NBPS(10, LE, 0, 10, int16_t)
403
+yuv2NBPS(16, BE, 1, 16, int32_t)
404
+yuv2NBPS(16, LE, 0, 16, int32_t)
405 405
 
406 406
 static void yuv2planeX_8_c(const int16_t *filter, int filterSize,
407 407
                            const int16_t **src, uint8_t *dest, int dstW,
... ...
@@ -586,8 +586,8 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *_buf0, \
586 586
                                   dstW, uvalpha, y, fmt); \
587 587
 }
588 588
 
589
-YUV2PACKED16WRAPPER(yuv2gray16,, LE, PIX_FMT_GRAY16LE);
590
-YUV2PACKED16WRAPPER(yuv2gray16,, BE, PIX_FMT_GRAY16BE);
589
+YUV2PACKED16WRAPPER(yuv2gray16,, LE, PIX_FMT_GRAY16LE)
590
+YUV2PACKED16WRAPPER(yuv2gray16,, BE, PIX_FMT_GRAY16BE)
591 591
 
592 592
 #define output_pixel(pos, acc) \
593 593
     if (target == PIX_FMT_MONOBLACK) { \
... ...
@@ -715,8 +715,8 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \
715 715
                                   y, fmt); \
716 716
 }
717 717
 
718
-YUV2PACKEDWRAPPER(yuv2mono,, white, PIX_FMT_MONOWHITE);
719
-YUV2PACKEDWRAPPER(yuv2mono,, black, PIX_FMT_MONOBLACK);
718
+YUV2PACKEDWRAPPER(yuv2mono,, white, PIX_FMT_MONOWHITE)
719
+YUV2PACKEDWRAPPER(yuv2mono,, black, PIX_FMT_MONOBLACK)
720 720
 
721 721
 #define output_pixels(pos, Y1, U, Y2, V) \
722 722
     if (target == PIX_FMT_YUYV422) { \
... ...
@@ -827,8 +827,8 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
827 827
 
828 828
 #undef output_pixels
829 829
 
830
-YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, PIX_FMT_YUYV422);
831
-YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, PIX_FMT_UYVY422);
830
+YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, PIX_FMT_YUYV422)
831
+YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, PIX_FMT_UYVY422)
832 832
 
833 833
 #define R_B ((target == PIX_FMT_RGB48LE || target == PIX_FMT_RGB48BE) ? R : B)
834 834
 #define B_R ((target == PIX_FMT_RGB48LE || target == PIX_FMT_RGB48BE) ? B : R)
... ...
@@ -1009,10 +1009,10 @@ yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0,
1009 1009
 #undef r_b
1010 1010
 #undef b_r
1011 1011
 
1012
-YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE);
1013
-YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE);
1014
-YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE);
1015
-YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE);
1012
+YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE)
1013
+YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE)
1014
+YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE)
1015
+YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE)
1016 1016
 
1017 1017
 static av_always_inline void
1018 1018
 yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2,
... ...
@@ -1310,24 +1310,24 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \
1310 1310
 }
1311 1311
 
1312 1312
 #if CONFIG_SMALL
1313
-YUV2RGBWRAPPER(yuv2rgb,,  32_1,  PIX_FMT_RGB32_1,   CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
1314
-YUV2RGBWRAPPER(yuv2rgb,,  32,    PIX_FMT_RGB32,     CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
1313
+YUV2RGBWRAPPER(yuv2rgb,,  32_1,  PIX_FMT_RGB32_1,   CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1314
+YUV2RGBWRAPPER(yuv2rgb,,  32,    PIX_FMT_RGB32,     CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1315 1315
 #else
1316 1316
 #if CONFIG_SWSCALE_ALPHA
1317
-YUV2RGBWRAPPER(yuv2rgb,, a32_1,  PIX_FMT_RGB32_1,   1);
1318
-YUV2RGBWRAPPER(yuv2rgb,, a32,    PIX_FMT_RGB32,     1);
1317
+YUV2RGBWRAPPER(yuv2rgb,, a32_1,  PIX_FMT_RGB32_1,   1)
1318
+YUV2RGBWRAPPER(yuv2rgb,, a32,    PIX_FMT_RGB32,     1)
1319 1319
 #endif
1320
-YUV2RGBWRAPPER(yuv2rgb,, x32_1,  PIX_FMT_RGB32_1,   0);
1321
-YUV2RGBWRAPPER(yuv2rgb,, x32,    PIX_FMT_RGB32,     0);
1320
+YUV2RGBWRAPPER(yuv2rgb,, x32_1,  PIX_FMT_RGB32_1,   0)
1321
+YUV2RGBWRAPPER(yuv2rgb,, x32,    PIX_FMT_RGB32,     0)
1322 1322
 #endif
1323
-YUV2RGBWRAPPER(yuv2, rgb, rgb24, PIX_FMT_RGB24,   0);
1324
-YUV2RGBWRAPPER(yuv2, rgb, bgr24, PIX_FMT_BGR24,   0);
1325
-YUV2RGBWRAPPER(yuv2rgb,,  16,    PIX_FMT_RGB565,    0);
1326
-YUV2RGBWRAPPER(yuv2rgb,,  15,    PIX_FMT_RGB555,    0);
1327
-YUV2RGBWRAPPER(yuv2rgb,,  12,    PIX_FMT_RGB444,    0);
1328
-YUV2RGBWRAPPER(yuv2rgb,,   8,    PIX_FMT_RGB8,      0);
1329
-YUV2RGBWRAPPER(yuv2rgb,,   4,    PIX_FMT_RGB4,      0);
1330
-YUV2RGBWRAPPER(yuv2rgb,,   4b,   PIX_FMT_RGB4_BYTE, 0);
1323
+YUV2RGBWRAPPER(yuv2, rgb, rgb24, PIX_FMT_RGB24,   0)
1324
+YUV2RGBWRAPPER(yuv2, rgb, bgr24, PIX_FMT_BGR24,   0)
1325
+YUV2RGBWRAPPER(yuv2rgb,,  16,    PIX_FMT_RGB565,    0)
1326
+YUV2RGBWRAPPER(yuv2rgb,,  15,    PIX_FMT_RGB555,    0)
1327
+YUV2RGBWRAPPER(yuv2rgb,,  12,    PIX_FMT_RGB444,    0)
1328
+YUV2RGBWRAPPER(yuv2rgb,,   8,    PIX_FMT_RGB8,      0)
1329
+YUV2RGBWRAPPER(yuv2rgb,,   4,    PIX_FMT_RGB4,      0)
1330
+YUV2RGBWRAPPER(yuv2rgb,,   4b,   PIX_FMT_RGB4_BYTE, 0)
1331 1331
 
1332 1332
 static av_always_inline void
1333 1333
 yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter,
... ...
@@ -1420,24 +1420,24 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter,
1420 1420
 }
1421 1421
 
1422 1422
 #if CONFIG_SMALL
1423
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
1424
-YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
1425
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
1426
-YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
1423
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1424
+YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1425
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1426
+YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB,  CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
1427 1427
 #else
1428 1428
 #if CONFIG_SWSCALE_ALPHA
1429
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA,  1);
1430
-YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR,  1);
1431
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA,  1);
1432
-YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB,  1);
1429
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA,  1)
1430
+YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR,  1)
1431
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA,  1)
1432
+YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB,  1)
1433 1433
 #endif
1434
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, PIX_FMT_BGRA,  0);
1435
-YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, PIX_FMT_ABGR,  0);
1436
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, PIX_FMT_RGBA,  0);
1437
-YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, PIX_FMT_ARGB,  0);
1434
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, PIX_FMT_BGRA,  0)
1435
+YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, PIX_FMT_ABGR,  0)
1436
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, PIX_FMT_RGBA,  0)
1437
+YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, PIX_FMT_ARGB,  0)
1438 1438
 #endif
1439
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full,  PIX_FMT_BGR24, 0);
1440
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full,  PIX_FMT_RGB24, 0);
1439
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full,  PIX_FMT_BGR24, 0)
1440
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full,  PIX_FMT_RGB24, 0)
1441 1441
 
1442 1442
 static av_always_inline void fillPlane(uint8_t* plane, int stride,
1443 1443
                                        int width, int height,
... ...
@@ -1537,10 +1537,10 @@ static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV
1537 1537
     rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin); \
1538 1538
 }
1539 1539
 
1540
-rgb48funcs(rgb, LE, PIX_FMT_RGB48LE);
1541
-rgb48funcs(rgb, BE, PIX_FMT_RGB48BE);
1542
-rgb48funcs(bgr, LE, PIX_FMT_BGR48LE);
1543
-rgb48funcs(bgr, BE, PIX_FMT_BGR48BE);
1540
+rgb48funcs(rgb, LE, PIX_FMT_RGB48LE)
1541
+rgb48funcs(rgb, BE, PIX_FMT_RGB48BE)
1542
+rgb48funcs(bgr, LE, PIX_FMT_BGR48LE)
1543
+rgb48funcs(bgr, BE, PIX_FMT_BGR48BE)
1544 1544
 
1545 1545
 #define input_pixel(i) ((origin == PIX_FMT_RGBA || origin == PIX_FMT_BGRA || \
1546 1546
                          origin == PIX_FMT_ARGB || origin == PIX_FMT_ABGR) ? AV_RN32A(&src[(i)*4]) : \
... ...
@@ -1655,18 +1655,18 @@ static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV, \
1655 1655
                                  maskr, maskg, maskb, rsh, gsh, bsh, S); \
1656 1656
 }
1657 1657
 
1658
-rgb16_32_wrapper(PIX_FMT_BGR32,    bgr32,  16, 0,  0, 0, 0xFF0000, 0xFF00,   0x00FF,  8, 0,  8, RGB2YUV_SHIFT+8);
1659
-rgb16_32_wrapper(PIX_FMT_BGR32_1,  bgr321, 16, 0,  0, 8, 0xFF0000, 0xFF00,   0x00FF,  8, 0,  8, RGB2YUV_SHIFT+8);
1660
-rgb16_32_wrapper(PIX_FMT_RGB32,    rgb32,   0, 0, 16, 0,   0x00FF, 0xFF00, 0xFF0000,  8, 0,  8, RGB2YUV_SHIFT+8);
1661
-rgb16_32_wrapper(PIX_FMT_RGB32_1,  rgb321,  0, 0, 16, 8,   0x00FF, 0xFF00, 0xFF0000,  8, 0,  8, RGB2YUV_SHIFT+8);
1662
-rgb16_32_wrapper(PIX_FMT_BGR565LE, bgr16le, 0, 0,  0, 0,   0x001F, 0x07E0,   0xF800, 11, 5,  0, RGB2YUV_SHIFT+8);
1663
-rgb16_32_wrapper(PIX_FMT_BGR555LE, bgr15le, 0, 0,  0, 0,   0x001F, 0x03E0,   0x7C00, 10, 5,  0, RGB2YUV_SHIFT+7);
1664
-rgb16_32_wrapper(PIX_FMT_RGB565LE, rgb16le, 0, 0,  0, 0,   0xF800, 0x07E0,   0x001F,  0, 5, 11, RGB2YUV_SHIFT+8);
1665
-rgb16_32_wrapper(PIX_FMT_RGB555LE, rgb15le, 0, 0,  0, 0,   0x7C00, 0x03E0,   0x001F,  0, 5, 10, RGB2YUV_SHIFT+7);
1666
-rgb16_32_wrapper(PIX_FMT_BGR565BE, bgr16be, 0, 0,  0, 0,   0x001F, 0x07E0,   0xF800, 11, 5,  0, RGB2YUV_SHIFT+8);
1667
-rgb16_32_wrapper(PIX_FMT_BGR555BE, bgr15be, 0, 0,  0, 0,   0x001F, 0x03E0,   0x7C00, 10, 5,  0, RGB2YUV_SHIFT+7);
1668
-rgb16_32_wrapper(PIX_FMT_RGB565BE, rgb16be, 0, 0,  0, 0,   0xF800, 0x07E0,   0x001F,  0, 5, 11, RGB2YUV_SHIFT+8);
1669
-rgb16_32_wrapper(PIX_FMT_RGB555BE, rgb15be, 0, 0,  0, 0,   0x7C00, 0x03E0,   0x001F,  0, 5, 10, RGB2YUV_SHIFT+7);
1658
+rgb16_32_wrapper(PIX_FMT_BGR32,    bgr32,  16, 0,  0, 0, 0xFF0000, 0xFF00,   0x00FF,  8, 0,  8, RGB2YUV_SHIFT+8)
1659
+rgb16_32_wrapper(PIX_FMT_BGR32_1,  bgr321, 16, 0,  0, 8, 0xFF0000, 0xFF00,   0x00FF,  8, 0,  8, RGB2YUV_SHIFT+8)
1660
+rgb16_32_wrapper(PIX_FMT_RGB32,    rgb32,   0, 0, 16, 0,   0x00FF, 0xFF00, 0xFF0000,  8, 0,  8, RGB2YUV_SHIFT+8)
1661
+rgb16_32_wrapper(PIX_FMT_RGB32_1,  rgb321,  0, 0, 16, 8,   0x00FF, 0xFF00, 0xFF0000,  8, 0,  8, RGB2YUV_SHIFT+8)
1662
+rgb16_32_wrapper(PIX_FMT_BGR565LE, bgr16le, 0, 0,  0, 0,   0x001F, 0x07E0,   0xF800, 11, 5,  0, RGB2YUV_SHIFT+8)
1663
+rgb16_32_wrapper(PIX_FMT_BGR555LE, bgr15le, 0, 0,  0, 0,   0x001F, 0x03E0,   0x7C00, 10, 5,  0, RGB2YUV_SHIFT+7)
1664
+rgb16_32_wrapper(PIX_FMT_RGB565LE, rgb16le, 0, 0,  0, 0,   0xF800, 0x07E0,   0x001F,  0, 5, 11, RGB2YUV_SHIFT+8)
1665
+rgb16_32_wrapper(PIX_FMT_RGB555LE, rgb15le, 0, 0,  0, 0,   0x7C00, 0x03E0,   0x001F,  0, 5, 10, RGB2YUV_SHIFT+7)
1666
+rgb16_32_wrapper(PIX_FMT_BGR565BE, bgr16be, 0, 0,  0, 0,   0x001F, 0x07E0,   0xF800, 11, 5,  0, RGB2YUV_SHIFT+8)
1667
+rgb16_32_wrapper(PIX_FMT_BGR555BE, bgr15be, 0, 0,  0, 0,   0x001F, 0x03E0,   0x7C00, 10, 5,  0, RGB2YUV_SHIFT+7)
1668
+rgb16_32_wrapper(PIX_FMT_RGB565BE, rgb16be, 0, 0,  0, 0,   0xF800, 0x07E0,   0x001F,  0, 5, 11, RGB2YUV_SHIFT+8)
1669
+rgb16_32_wrapper(PIX_FMT_RGB555BE, rgb15be, 0, 0,  0, 0,   0x7C00, 0x03E0,   0x001F,  0, 5, 10, RGB2YUV_SHIFT+7)
1670 1670
 
1671 1671
 static void gbr24pToUV_half_c(uint16_t *dstU, uint16_t *dstV,
1672 1672
                          const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc,
... ...
@@ -242,7 +242,7 @@ extern void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt(
242 242
                                                 SwsContext *c, int16_t *data, \
243 243
                                                 int dstW, const uint8_t *src, \
244 244
                                                 const int16_t *filter, \
245
-                                                const int16_t *filterPos, int filterSize);
245
+                                                const int16_t *filterPos, int filterSize)
246 246
 
247 247
 #define SCALE_FUNCS(filter_n, opt) \
248 248
     SCALE_FUNC(filter_n,  8, 15, opt); \
... ...
@@ -67,7 +67,7 @@ $EGREP $OPT '^\+ *(const *|)static' $*| $EGREP --color=always '[^=]= *(0|NULL)[^
67 67
 cat $TMP
68 68
 hiegrep '# *ifdef * (HAVE|CONFIG)_' 'ifdefs that should be #if' $*
69 69
 
70
-hiegrep '\b(awnser|cant|dont|quantised|quantisation|teh|wont)\b' 'common typos' $*
70
+hiegrep '\b(awnser|cant|dont|wont|usefull|successfull|occured|teh|alot|wether|skiped|heigth|informations|colums|loosy|loosing|seperate|preceed)\b' 'common typos' $*
71 71
 
72 72
 hiegrep 'av_log\( *NULL' 'Missing context in av_log' $*
73 73
 hiegrep '[^sn]printf' 'Please use av_log' $*