aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-12 01:25:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-12 01:25:37 +0100
commit7fad19a63dc52db4bf2bebbd9d261675956b1b34 (patch)
tree8997428f45d54f3177dc6cd208d0375daa6fe201
parent16abd687798bbf9192ba4954765e61de96065b8b (diff)
parent599b4c6efddaed33b1667c386b34b07729ba732b (diff)
downloadffmpeg-7fad19a63dc52db4bf2bebbd9d261675956b1b34.tar.gz
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>
-rw-r--r--avconv.c2
-rw-r--r--cmdutils.h6
-rw-r--r--doc/avconv.texi2
-rw-r--r--doc/ffserver.texi2
-rw-r--r--doc/protocols.texi4
-rw-r--r--doc/soc.txt2
-rw-r--r--ffmpeg.c2
-rw-r--r--ffplay.c2
-rw-r--r--ffserver.c2
-rw-r--r--libavcodec/avcodec.h4
-rw-r--r--libavcodec/binkaudio.c6
-rw-r--r--libavcodec/bitstream.c2
-rw-r--r--libavcodec/eatgv.c4
-rw-r--r--libavcodec/error_resilience.c2
-rw-r--r--libavcodec/g722enc.c2
-rw-r--r--libavcodec/h264.c10
-rw-r--r--libavcodec/h264pred_template.c12
-rw-r--r--libavcodec/jfdctint_template.c2
-rw-r--r--libavcodec/lpc.h2
-rw-r--r--libavcodec/mjpegdec.c6
-rw-r--r--libavcodec/proresdec_lgpl.c2
-rw-r--r--libavcodec/tscc.c2
-rw-r--r--libavcodec/utils.c3
-rw-r--r--libavcodec/vaapi_mpeg4.c2
-rw-r--r--libavcodec/vc1dec.c6
-rw-r--r--libavcodec/vc1dsp.c4
-rw-r--r--libavcodec/wmaprodec.c7
-rw-r--r--libavcodec/wmavoice.c4
-rw-r--r--libavcodec/x86/cabac.h53
-rw-r--r--libavcodec/x86/h264_i386.h31
-rw-r--r--libavcodec/x86/vc1dsp_yasm.asm2
-rw-r--r--libavdevice/jack_audio.c2
-rw-r--r--libavdevice/timefilter.h2
-rw-r--r--libavformat/4xm.c4
-rw-r--r--libavformat/aiffdec.c10
-rw-r--r--libavformat/aiffenc.c9
-rw-r--r--libavformat/avformat.h7
-rw-r--r--libavformat/cafdec.c4
-rw-r--r--libavformat/ffmdec.c16
-rw-r--r--libavformat/ffmenc.c16
-rw-r--r--libavformat/flvdec.c6
-rw-r--r--libavformat/flvenc.c6
-rw-r--r--libavformat/gxfenc.c6
-rw-r--r--libavformat/http.c2
-rw-r--r--libavformat/id3v2.c2
-rw-r--r--libavformat/img2.c2
-rw-r--r--libavformat/iv8.c2
-rw-r--r--libavformat/matroskadec.c8
-rw-r--r--libavformat/matroskaenc.c4
-rw-r--r--libavformat/mms.h2
-rw-r--r--libavformat/mov.c4
-rw-r--r--libavformat/movenc.c25
-rw-r--r--libavformat/movenc.h3
-rw-r--r--libavformat/movenchint.c17
-rw-r--r--libavformat/mpegts.c2
-rw-r--r--libavformat/mpegtsenc.c2
-rw-r--r--libavformat/mxfenc.c2
-rw-r--r--libavformat/nuv.c6
-rw-r--r--libavformat/rdt.c2
-rw-r--r--libavformat/rtmppkt.c8
-rw-r--r--libavformat/rtmpproto.c6
-rw-r--r--libavformat/rtp.h2
-rw-r--r--libavformat/rtpenc_h264.c33
-rw-r--r--libavformat/sdp.c17
-rw-r--r--libavformat/soxdec.c6
-rw-r--r--libavformat/soxenc.c6
-rw-r--r--libavformat/thp.c4
-rw-r--r--libavformat/udp.c2
-rw-r--r--libavformat/utils.c2
-rw-r--r--libavutil/eval.h2
-rw-r--r--libavutil/intfloat.h73
-rw-r--r--libavutil/intfloat_readwrite.h12
-rw-r--r--libpostproc/postprocess.c2
-rw-r--r--libpostproc/postprocess_internal.h2
-rw-r--r--libswscale/rgb2rgb.c8
-rw-r--r--libswscale/swscale.c120
-rw-r--r--libswscale/x86/swscale_mmx.c2
-rwxr-xr-xtools/patcheck2
78 files changed, 388 insertions, 286 deletions
diff --git a/avconv.c b/avconv.c
index 4c99a6fdd7..6195f4f9fb 100644
--- a/avconv.c
+++ b/avconv.c
@@ -3783,7 +3783,7 @@ static void opt_output_file(void *optctx, const char *filename)
}
if (!(oc->oformat->flags & AVFMT_NOFILE)) {
- /* test if it already exists to avoid loosing precious files */
+ /* test if it already exists to avoid losing precious files */
assert_file_overwrite(filename);
/* open the file */
diff --git a/cmdutils.h b/cmdutils.h
index 15f983643a..03080b5216 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -91,7 +91,7 @@ int opt_timelimit(const char *opt, const char *arg);
* parsed or the corresponding value is invalid.
*
* @param context the context of the value to be set (e.g. the
- * corresponding commandline option name)
+ * corresponding command line option name)
* @param numstr the string to be parsed
* @param type the type (OPT_INT64 or OPT_FLOAT) as which the
* string should be parsed
@@ -106,7 +106,7 @@ double parse_number_or_die(const char *context, const char *numstr, int type, do
* the string cannot be correctly parsed.
*
* @param context the context of the value to be set (e.g. the
- * corresponding commandline option name)
+ * corresponding command line option name)
* @param timestr the string to be parsed
* @param is_duration a flag which tells how to interpret timestr, if
* 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
int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options);
/**
- * Find the '-loglevel' option in the commandline args and apply it.
+ * Find the '-loglevel' option in the command line args and apply it.
*/
void parse_loglevel(int argc, char **argv, const OptionDef *options);
diff --git a/doc/avconv.texi b/doc/avconv.texi
index 14e02f8f95..f83cf590b6 100644
--- a/doc/avconv.texi
+++ b/doc/avconv.texi
@@ -29,7 +29,7 @@ rates and resize video on the fly with a high quality polyphase filter.
avconv reads from an arbitrary number of input "files" (which can be regular
files, pipes, network streams, grabbing devices, etc.), specified by the
@code{-i} option, and writes to an arbitrary number of output "files", which are
-specified by a plain output filename. Anything found on the commandline which
+specified by a plain output filename. Anything found on the command line which
cannot be interpreted as an option is considered to be an output filename.
Each input or output file can in principle contain any number of streams of
diff --git a/doc/ffserver.texi b/doc/ffserver.texi
index 1b9a494f49..074c075f0b 100644
--- a/doc/ffserver.texi
+++ b/doc/ffserver.texi
@@ -147,7 +147,7 @@ that only captures in stereo and also requires that one channel be flipped.
If you are one of these people, then export 'AUDIO_FLIP_LEFT=1' before
starting ffmpeg.
-@subsection The audio and video loose sync after a while.
+@subsection The audio and video lose sync after a while.
Yes, they do.
diff --git a/doc/protocols.texi b/doc/protocols.texi
index c55606b986..eab4a6aff9 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -155,8 +155,8 @@ be seekable, so they will fail with the pipe output protocol.
Real-Time Messaging Protocol.
-The Real-Time Messaging Protocol (RTMP) is used for streaming
-multimedia content across a TCP/IP network.
+The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
+content across a TCP/IP network.
The required syntax is:
@example
diff --git a/doc/soc.txt b/doc/soc.txt
index 79d77d1cd7..2504dba553 100644
--- a/doc/soc.txt
+++ b/doc/soc.txt
@@ -18,7 +18,7 @@ essential that changes to their codebase are publicly visible, clean and
easy reviewable that again leads us to:
* use of a revision control system like git
* separation of cosmetic from non-cosmetic changes (this is almost entirely
- ignored by mentors and students in soc 2006 which might lead to a suprise
+ ignored by mentors and students in soc 2006 which might lead to a surprise
when the code will be reviewed at the end before a possible inclusion in
FFmpeg, individual changes were generally not reviewable due to cosmetics).
* frequent commits, so that comments can be provided early
diff --git a/ffmpeg.c b/ffmpeg.c
index ee79e32039..daa014b0e6 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -4162,7 +4162,7 @@ static void opt_output_file(void *optctx, const char *filename)
}
if (!(oc->oformat->flags & AVFMT_NOFILE)) {
- /* test if it already exists to avoid loosing precious files */
+ /* test if it already exists to avoid losing precious files */
assert_file_overwrite(filename);
/* open the file */
diff --git a/ffplay.c b/ffplay.c
index 7ebe6f3b44..a613e8800e 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2468,8 +2468,6 @@ static int read_thread(void *arg)
if(genpts)
ic->flags |= AVFMT_FLAG_GENPTS;
- av_dict_set(&codec_opts, "request_channels", "2", 0);
-
opts = setup_find_stream_info_opts(ic, codec_opts);
orig_nb_streams = ic->nb_streams;
diff --git a/ffserver.c b/ffserver.c
index 1244b45b90..b66f7e69dd 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -475,7 +475,7 @@ static void start_children(FFStream *feed)
slash++;
strcpy(slash, "ffmpeg");
- http_log("Launch commandline: ");
+ http_log("Launch command line: ");
http_log("%s ", pathname);
for (i = 1; feed->child_argv[i] && feed->child_argv[i][0]; i++)
http_log("%s ", feed->child_argv[i]);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 23048ddb72..63ef000198 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1348,7 +1348,7 @@ typedef struct AVCodecContext {
* Some codecs need additional format info. It is stored here.
* If any muxer uses this then ALL demuxers/parsers AND encoders for the
* specific codec MUST set it correctly otherwise stream copy breaks.
- * In general use of this field by muxers is not recommanded.
+ * In general use of this field by muxers is not recommended.
* - encoding: Set by libavcodec.
* - decoding: Set by libavcodec. (FIXME: Is this OK?)
*/
@@ -3541,7 +3541,7 @@ typedef struct ReSampleContext ReSampleContext;
* @param linear if 1 then the used FIR filter will be linearly interpolated
between the 2 closest, if 0 the closest will be used
* @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
- * @return allocated ReSampleContext, NULL if error occured
+ * @return allocated ReSampleContext, NULL if error occurred
*/
ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
int output_rate, int input_rate,
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 94be26ed49..c60f0687bf 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -35,7 +35,7 @@
#include "dct.h"
#include "rdft.h"
#include "fmtconvert.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
extern const uint16_t ff_wma_critical_freqs[25];
@@ -193,8 +193,8 @@ static int decode_block(BinkAudioContext *s, int16_t *out, int use_dct)
if (s->version_b) {
if (get_bits_left(gb) < 64)
return AVERROR_INVALIDDATA;
- coeffs[0] = av_int2flt(get_bits(gb, 32)) * s->root;
- coeffs[1] = av_int2flt(get_bits(gb, 32)) * s->root;
+ coeffs[0] = av_int2float(get_bits_long(gb, 32)) * s->root;
+ coeffs[1] = av_int2float(get_bits_long(gb, 32)) * s->root;
} else {
if (get_bits_left(gb) < 58)
return AVERROR_INVALIDDATA;
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index d4d7623bc3..30aaf75fea 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -103,7 +103,7 @@ static int alloc_table(VLC *vlc, int size, int use_static)
vlc->table_size += size;
if (vlc->table_size > vlc->table_allocated) {
if(use_static)
- abort(); //cant do anything, init_vlc() is used with too little memory
+ abort(); // cannot do anything, init_vlc() is used with too little memory
vlc->table_allocated += (1 << vlc->bits);
vlc->table = av_realloc_f(vlc->table,
vlc->table_allocated, sizeof(VLC_TYPE) * 2);
diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index 91ae94c46a..7b0cd3467c 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -157,7 +157,7 @@ static int tgv_decode_inter(TgvContext * s, const uint8_t *buf, const uint8_t *b
vector_bits = AV_RL16(&buf[6]);
buf += 12;
- /* allocate codebook buffers as neccessary */
+ /* allocate codebook buffers as necessary */
if (num_mvs > s->num_mvs) {
s->mv_codebook = av_realloc(s->mv_codebook, num_mvs*2*sizeof(int));
s->num_mvs = num_mvs;
@@ -293,7 +293,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
s->frame.linesize[0] = s->width;
- /* allocate additional 12 bytes to accomodate av_memcpy_backptr() OUTBUF_PADDED optimisation */
+ /* allocate additional 12 bytes to accommodate av_memcpy_backptr() OUTBUF_PADDED optimisation */
s->frame.data[0] = av_malloc(s->width*s->height + 12);
if (!s->frame.data[0])
return AVERROR(ENOMEM);
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 8a2a7ae3eb..115e4239e9 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -801,7 +801,7 @@ void ff_er_frame_end(MpegEncContext *s){
if(!s->error_recognition || s->error_count==0 || s->avctx->lowres ||
s->avctx->hwaccel ||
s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU ||
- s->picture_structure != PICT_FRAME || // we dont support ER of field pictures yet, though it should not crash if enabled
+ s->picture_structure != PICT_FRAME || // we do not support ER of field pictures yet, though it should not crash if enabled
s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return;
if (s->current_picture.f.motion_val[0] == NULL) {
diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c
index f8db49aba8..1eed784a72 100644
--- a/libavcodec/g722enc.c
+++ b/libavcodec/g722enc.c
@@ -153,7 +153,7 @@ static int g722_encode_trellis(AVCodecContext *avctx,
for (j = 0; j < frontier && nodes[0][j]; j++) {
/* Only k >> 2 affects the future adaptive state, therefore testing
- * small steps that don't change k >> 2 is useless, the orignal
+ * small steps that don't change k >> 2 is useless, the original
* value from encode_low is better than them. Since we step k
* in steps of 4, make sure range is a multiple of 4, so that
* we don't miss the original value from encode_low. */
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 7daca10c02..f145a63f64 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2201,8 +2201,8 @@ static av_always_inline void hl_decode_mb_444_internal(H264Context *h, int simpl
static void hl_decode_mb_simple_ ## bits(H264Context *h){ \
hl_decode_mb_internal(h, 1, sh); \
}
-hl_decode_mb_simple(0, 8);
-hl_decode_mb_simple(1, 16);
+hl_decode_mb_simple(0, 8)
+hl_decode_mb_simple(1, 16)
/**
* Process a macroblock; this handles edge cases, such as interlacing.
@@ -2926,7 +2926,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
* FIXME: avoiding a memcpy would be nice, but ref handling makes many assumptions
* about there being no actual duplicates.
* FIXME: this doesn't copy padding for out-of-frame motion vectors. Given we're
- * concealing a lost frame, this probably isn't noticable by comparison, but it should
+ * concealing a lost frame, this probably isn't noticeable by comparison, but it should
* be fixed. */
if (h->short_ref_count) {
if (prev) {
@@ -3354,7 +3354,7 @@ static av_always_inline void fill_filter_caches_inter(H264Context *h, MpegEncCon
/**
*
- * @return non zero if the loop filter can be skiped
+ * @return non zero if the loop filter can be skipped
*/
static int fill_filter_caches(H264Context *h, int mb_type){
MpegEncContext * const s = &h->s;
@@ -3879,7 +3879,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
av_log(h->s.avctx, AV_LOG_ERROR, "Invalid mix of idr and non-idr slices");
return -1;
}
- idr(h); //FIXME ensure we don't loose some frames if there is reordering
+ idr(h); // FIXME ensure we don't lose some frames if there is reordering
case NAL_SLICE:
init_get_bits(&hx->s.gb, ptr, bit_length);
hx->intra_gb_ptr=
diff --git a/libavcodec/h264pred_template.c b/libavcodec/h264pred_template.c
index 074fad50ca..3a1b1cf94e 100644
--- a/libavcodec/h264pred_template.c
+++ b/libavcodec/h264pred_template.c
@@ -388,9 +388,9 @@ static void FUNCC(pred16x16_##n##_dc)(uint8_t *_src, int stride){\
PREDICT_16x16_DC(PIXEL_SPLAT_X4(v));\
}
-PRED16x16_X(127, (1<<(BIT_DEPTH-1))-1);
-PRED16x16_X(128, (1<<(BIT_DEPTH-1))+0);
-PRED16x16_X(129, (1<<(BIT_DEPTH-1))+1);
+PRED16x16_X(127, (1<<(BIT_DEPTH-1))-1)
+PRED16x16_X(128, (1<<(BIT_DEPTH-1))+0)
+PRED16x16_X(129, (1<<(BIT_DEPTH-1))+1)
static inline void FUNCC(pred16x16_plane_compat)(uint8_t *p_src, int p_stride, const int svq3, const int rv40){
int i, j, k;
@@ -502,9 +502,9 @@ static void FUNCC(pred8x8_##n##_dc)(uint8_t *_src, int stride){\
}\
}
-PRED8x8_X(127, (1<<(BIT_DEPTH-1))-1);
-PRED8x8_X(128, (1<<(BIT_DEPTH-1))+0);
-PRED8x8_X(129, (1<<(BIT_DEPTH-1))+1);
+PRED8x8_X(127, (1<<(BIT_DEPTH-1))-1)
+PRED8x8_X(128, (1<<(BIT_DEPTH-1))+0)
+PRED8x8_X(129, (1<<(BIT_DEPTH-1))+1)
static void FUNCC(pred8x16_128_dc)(uint8_t *_src, int stride){
FUNCC(pred8x8_128_dc)(_src, stride);
diff --git a/libavcodec/jfdctint_template.c b/libavcodec/jfdctint_template.c
index 02b6f09381..5175390710 100644
--- a/libavcodec/jfdctint_template.c
+++ b/libavcodec/jfdctint_template.c
@@ -340,7 +340,7 @@ FUNC(ff_jpeg_fdct_islow)(DCTELEM *data)
/*
* The secret of DCT2-4-8 is really simple -- you do the usual 1-DCT
- * on the rows and then, instead of doing even and odd, part on the colums
+ * on the rows and then, instead of doing even and odd, part on the columns
* you do even part two times.
*/
GLOBAL(void)
diff --git a/libavcodec/lpc.h b/libavcodec/lpc.h
index 9db5dbac30..8b70a9d5d7 100644
--- a/libavcodec/lpc.h
+++ b/libavcodec/lpc.h
@@ -67,7 +67,7 @@ typedef struct LPCContext {
* Perform autocorrelation on input samples with delay of 0 to lag.
* @param data input samples.
* constraints: no alignment needed, but must have have at
- * least lag*sizeof(double) valid bytes preceeding it, and
+ * least lag*sizeof(double) valid bytes preceding it, and
* size must be at least (len+1)*sizeof(double) if data is
* 16-byte aligned or (len+2)*sizeof(double) if data is
* unaligned.
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 5a51201d9d..a1ff022712 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1114,9 +1114,9 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
av_log(s->avctx, AV_LOG_DEBUG, "APPx %8X\n", id);
}
- /* buggy AVID, it puts EOI only at every 10th frame */
- /* also this fourcc is used by non-avid files too, it holds some
- informations, but it's always present in AVID creates files */
+ /* Buggy AVID, it puts EOI only at every 10th frame. */
+ /* Also, this fourcc is used by non-avid files too, it holds some
+ information, but it's always present in AVID-created files. */
if (id == AV_RL32("AVI1"))
{
/* structure:
diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c
index 84d81ee425..5a1fcd2e0c 100644
--- a/libavcodec/proresdec_lgpl.c
+++ b/libavcodec/proresdec_lgpl.c
@@ -559,7 +559,7 @@ static int decode_slice(AVCodecContext *avctx, ProresThreadData *td)
sf = sf > 128 ? (sf - 96) << 2 : sf;
/* scale quantization matrixes according with slice's scale factor */
- /* TODO: this can be SIMD-optimized alot */
+ /* TODO: this can be SIMD-optimized a lot */
if (ctx->qmat_changed || sf != ctx->prev_slice_sf) {
ctx->prev_slice_sf = sf;
for (i = 0; i < 64; i++) {
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index 39a0fa91fa..16b987e7c7 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -156,7 +156,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return -1;
}
c->bpp = avctx->bits_per_coded_sample;
- // buffer size for RLE 'best' case when 2-byte code preceeds each pixel and there may be padding after it too
+ // buffer size for RLE 'best' case when 2-byte code precedes each pixel and there may be padding after it too
c->decomp_size = (((avctx->width * c->bpp + 7) >> 3) + 3 * avctx->width + 2) * avctx->height + 2;
/* Allocate decompression buffer */
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 1685b4d196..6ecda398ad 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -544,7 +544,8 @@ void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic){
avci->buffer_count--;
last = &avci->buffer[avci->buffer_count];
- FFSWAP(InternalBuffer, *buf, *last);
+ if (buf != last)
+ FFSWAP(InternalBuffer, *buf, *last);
}
for (i = 0; i < AV_NUM_DATA_POINTERS; i++) {
diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c
index b3dcc14457..946095320b 100644
--- a/libavcodec/vaapi_mpeg4.c
+++ b/libavcodec/vaapi_mpeg4.c
@@ -98,7 +98,7 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
/* Fill in VAIQMatrixBufferMPEG4 */
- /* Only the first inverse quantisation method uses the weighthing matrices */
+ /* Only the first inverse quantisation method uses the weighting matrices */
if (pic_param->vol_fields.bits.quant_type) {
iq_matrix = ff_vaapi_alloc_iq_matrix(vactx, sizeof(VAIQMatrixBufferMPEG4));
if (!iq_matrix)
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 20b7f72291..6844c9cb2d 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -3536,7 +3536,7 @@ static void vc1_apply_p_loop_filter(VC1Context *v)
vc1_apply_p_v_loop_filter(v, i);
}
- /* V always preceedes H, therefore we run H one MB before V;
+ /* V always precedes H, therefore we run H one MB before V;
* at the end of a row, we catch up to complete the row */
if (s->mb_x) {
for (i = 0; i < 6; i++) {
@@ -3573,7 +3573,7 @@ static int vc1_decode_p_mb(VC1Context *v)
int skipped, fourmv;
int block_cbp = 0, pat, block_tt = 0, block_intra = 0;
- mquant = v->pq; /* Loosy initialization */
+ mquant = v->pq; /* lossy initialization */
if (v->mv_type_is_raw)
fourmv = get_bits1(gb);
@@ -4141,7 +4141,7 @@ static void vc1_decode_b_mb(VC1Context *v)
int dmv_x[2], dmv_y[2];
int bmvtype = BMV_TYPE_BACKWARD;
- mquant = v->pq; /* Loosy initialization */
+ mquant = v->pq; /* lossy initialization */
s->mb_intra = 0;
if (v->dmb_is_raw)
diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c
index a9a7dff761..83cd0cfe8c 100644
--- a/libavcodec/vc1dsp.c
+++ b/libavcodec/vc1dsp.c
@@ -550,8 +550,8 @@ static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src,
return 0; /* should not occur */ \
}
-VC1_MSPEL_FILTER_16B(ver, uint8_t);
-VC1_MSPEL_FILTER_16B(hor, int16_t);
+VC1_MSPEL_FILTER_16B(ver, uint8_t)
+VC1_MSPEL_FILTER_16B(hor, int16_t)
/** Filter used to interpolate fractional pel values
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 3f022c7208..eccfb55432 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -86,6 +86,7 @@
* subframe in order to reconstruct the output samples.
*/
+#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "internal.h"
@@ -823,8 +824,8 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c)
v1 = get_vlc2(&s->gb, vec1_vlc.table, VLCBITS, VEC1MAXDEPTH);
if (v1 == HUFF_VEC1_SIZE - 1)
v1 += ff_wma_get_large_val(&s->gb);
- vals[i ] = ((av_alias32){ .f32 = v0 }).u32;
- vals[i+1] = ((av_alias32){ .f32 = v1 }).u32;
+ vals[i ] = av_float2int(v0);
+ vals[i+1] = av_float2int(v1);
} else {
vals[i] = fval_tab[symbol_to_vec2[idx] >> 4 ];
vals[i+1] = fval_tab[symbol_to_vec2[idx] & 0xF];
@@ -1425,7 +1426,7 @@ static int remaining_bits(WMAProDecodeCtx *s, GetBitContext *gb)
*@param s codec context
*@param gb bitstream reader context
*@param len length of the partial frame
- *@param append decides wether to reset the buffer or not
+ *@param append decides whether to reset the buffer or not
*/
static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
int append)
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 45383b033b..a160cf36a8 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -189,7 +189,7 @@ typedef struct {
* @{
*/
int spillover_nbits; ///< number of bits of the previous packet's
- ///< last superframe preceeding this
+ ///< last superframe preceding this
///< packet's first full superframe (useful
///< for re-synchronization also)
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)
s->frame.nb_samples = n_samples;
samples = (float *)s->frame.data[0];
- /* Parse frames, optionally preceeded by per-frame (independent) LSPs. */
+ /* Parse frames, optionally preceded by per-frame (independent) LSPs. */
for (n = 0; n < 3; n++) {
if (!s->has_residual_lsps) {
int m;
diff --git a/libavcodec/x86/cabac.h b/libavcodec/x86/cabac.h
index 33304ab0f4..d0d1332094 100644
--- a/libavcodec/x86/cabac.h
+++ b/libavcodec/x86/cabac.h
@@ -27,7 +27,7 @@
#include "config.h"
#if HAVE_FAST_CMOV
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp)\
+#define BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)\
"mov "tmp" , %%ecx \n\t"\
"shl $17 , "tmp" \n\t"\
"cmp "low" , "tmp" \n\t"\
@@ -37,7 +37,7 @@
"xor %%ecx , "ret" \n\t"\
"sub "tmp" , "low" \n\t"
#else /* HAVE_FAST_CMOV */
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp)\
+#define BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)\
"mov "tmp" , %%ecx \n\t"\
"shl $17 , "tmp" \n\t"\
"sub "low" , "tmp" \n\t"\
@@ -51,14 +51,13 @@
"xor "tmp" , "ret" \n\t"
#endif /* HAVE_FAST_CMOV */
-#define BRANCHLESS_GET_CABAC(ret, cabac, statep, low, lowword, range, tmp, tmpbyte, byte) \
+#define BRANCHLESS_GET_CABAC(ret, statep, low, lowword, range, tmp, tmpbyte, byte) \
"movzbl "statep" , "ret" \n\t"\
"mov "range" , "tmp" \n\t"\
"and $0xC0 , "range" \n\t"\
"movzbl "MANGLE(ff_h264_lps_range)"("ret", "range", 2), "range" \n\t"\
"sub "range" , "tmp" \n\t"\
- BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, \
- range, tmp) \
+ BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp) \
"movzbl " MANGLE(ff_h264_norm_shift) "("range"), %%ecx \n\t"\
"shl %%cl , "range" \n\t"\
"movzbl "MANGLE(ff_h264_mlps_state)"+128("ret"), "tmp" \n\t"\
@@ -66,8 +65,8 @@
"mov "tmpbyte" , "statep" \n\t"\
"test "lowword" , "lowword" \n\t"\
" jnz 1f \n\t"\
- "mov "byte"("cabac"), %%"REG_c" \n\t"\
- "add"OPSIZE" $2 , "byte "("cabac") \n\t"\
+ "mov "byte" , %%"REG_c" \n\t"\
+ "add"OPSIZE" $2 , "byte" \n\t"\
"movzwl (%%"REG_c") , "tmp" \n\t"\
"lea -1("low") , %%ecx \n\t"\
"xor "low" , %%ecx \n\t"\
@@ -82,38 +81,32 @@
"add "tmp" , "low" \n\t"\
"1: \n\t"
-#if HAVE_7REGS && !defined(BROKEN_RELOCATIONS)
+#if HAVE_6REGS && !defined(BROKEN_RELOCATIONS)
#define get_cabac_inline get_cabac_inline_x86
static av_always_inline int get_cabac_inline_x86(CABACContext *c,
uint8_t *const state)
{
- int bit, low, range, tmp;
+ int bit, tmp;
__asm__ volatile(
- "movl %a6(%5), %2 \n\t"
- "movl %a7(%5), %1 \n\t"
- BRANCHLESS_GET_CABAC("%0", "%5", "(%4)", "%1", "%w1", "%2",
- "%3", "%b3", "%a8")
- "movl %2, %a6(%5) \n\t"
- "movl %1, %a7(%5) \n\t"
-
- :"=&r"(bit), "=&r"(low), "=&r"(range), "=&q"(tmp)
- :"r"(state), "r"(c),
- "i"(offsetof(CABACContext, range)), "i"(offsetof(CABACContext, low)),
- "i"(offsetof(CABACContext, bytestream))
+ BRANCHLESS_GET_CABAC("%0", "(%5)", "%1", "%w1", "%2",
+ "%3", "%b3", "%4")
+ :"=&r"(bit), "+&r"(c->low), "+&r"(c->range), "=&q"(tmp),
+ "+m"(c->bytestream)
+ :"r"(state)
: "%"REG_c, "memory"
);
return bit & 1;
}
-#endif /* HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */
+#endif /* HAVE_6REGS && !defined(BROKEN_RELOCATIONS) */
#define get_cabac_bypass_sign get_cabac_bypass_sign_x86
static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
{
x86_reg tmp;
__asm__ volatile(
- "movl %a3(%2), %k1 \n\t"
- "movl %a4(%2), %%eax \n\t"
+ "movl %4, %k1 \n\t"
+ "movl %2, %%eax \n\t"
"shl $17, %k1 \n\t"
"add %%eax, %%eax \n\t"
"sub %k1, %%eax \n\t"
@@ -124,22 +117,20 @@ static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
"sub %%edx, %%ecx \n\t"
"test %%ax, %%ax \n\t"
" jnz 1f \n\t"
- "mov %a5(%2), %1 \n\t"
+ "mov %3, %1 \n\t"
"subl $0xFFFF, %%eax \n\t"
"movzwl (%1), %%edx \n\t"
"bswap %%edx \n\t"
"shrl $15, %%edx \n\t"
"add $2, %1 \n\t"
"addl %%edx, %%eax \n\t"
- "mov %1, %a5(%2) \n\t"
+ "mov %1, %3 \n\t"
"1: \n\t"
- "movl %%eax, %a4(%2) \n\t"
+ "movl %%eax, %2 \n\t"
- :"+c"(val), "=&r"(tmp)
- :"r"(c),
- "i"(offsetof(CABACContext, range)), "i"(offsetof(CABACContext, low)),
- "i"(offsetof(CABACContext, bytestream))
- : "%eax", "%edx", "memory"
+ :"+c"(val), "=&r"(tmp), "+m"(c->low), "+m"(c->bytestream)
+ :"m"(c->range)
+ : "%eax", "%edx"
);
return val;
}
diff --git a/libavcodec/x86/h264_i386.h b/libavcodec/x86/h264_i386.h
index 84da48d2e2..089762b1dd 100644
--- a/libavcodec/x86/h264_i386.h
+++ b/libavcodec/x86/h264_i386.h
@@ -36,7 +36,7 @@
//FIXME use some macros to avoid duplicating get_cabac (cannot be done yet
//as that would make optimization work hard)
-#if HAVE_7REGS && !defined(BROKEN_RELOCATIONS)
+#if HAVE_6REGS && !defined(BROKEN_RELOCATIONS)
static int decode_significance_x86(CABACContext *c, int max_coeff,
uint8_t *significant_coeff_ctx_base,
int *index, x86_reg last_off){
@@ -48,15 +48,15 @@ static int decode_significance_x86(CABACContext *c, int max_coeff,
__asm__ volatile(
"2: \n\t"
- BRANCHLESS_GET_CABAC("%4", "%6", "(%1)", "%3",
- "%w3", "%5", "%k0", "%b0", "%a11")
+ BRANCHLESS_GET_CABAC("%4", "(%1)", "%3",
+ "%w3", "%5", "%k0", "%b0", "%6")
"test $1, %4 \n\t"
" jz 3f \n\t"
"add %10, %1 \n\t"
- BRANCHLESS_GET_CABAC("%4", "%6", "(%1)", "%3",
- "%w3", "%5", "%k0", "%b0", "%a11")
+ BRANCHLESS_GET_CABAC("%4", "(%1)", "%3",
+ "%w3", "%5", "%k0", "%b0", "%6")
"sub %10, %1 \n\t"
"mov %2, %0 \n\t"
@@ -81,9 +81,9 @@ static int decode_significance_x86(CABACContext *c, int max_coeff,
"add %9, %k0 \n\t"
"shr $2, %k0 \n\t"
:"=&q"(coeff_count), "+r"(significant_coeff_ctx_base), "+m"(index),
- "+&r"(c->low), "=&r"(bit), "+&r"(c->range)
- :"r"(c), "m"(minusstart), "m"(end), "m"(minusindex), "m"(last_off),
- "i"(offsetof(CABACContext, bytestream))
+ "+&r"(c->low), "=&r"(bit), "+&r"(c->range),
+ "+m"(c->bytestream)
+ :"m"(minusstart), "m"(end), "m"(minusindex), "m"(last_off)
: "%"REG_c, "memory"
);
return coeff_count;
@@ -105,8 +105,8 @@ static int decode_significance_8x8_x86(CABACContext *c,
"movzbl (%0, %6), %k6 \n\t"
"add %9, %6 \n\t"
- BRANCHLESS_GET_CABAC("%4", "%7", "(%6)", "%3",
- "%w3", "%5", "%k0", "%b0", "%a12")
+ BRANCHLESS_GET_CABAC("%4", "(%6)", "%3",
+ "%w3", "%5", "%k0", "%b0", "%7")
"mov %1, %k6 \n\t"
"test $1, %4 \n\t"
@@ -115,8 +115,8 @@ static int decode_significance_8x8_x86(CABACContext *c,
"movzbl "MANGLE(last_coeff_flag_offset_8x8)"(%k6), %k6\n\t"
"add %11, %6 \n\t"
- BRANCHLESS_GET_CABAC("%4", "%7", "(%6)", "%3",
- "%w3", "%5", "%k0", "%b0", "%a12")
+ BRANCHLESS_GET_CABAC("%4", "(%6)", "%3",
+ "%w3", "%5", "%k0", "%b0", "%7")
"mov %2, %0 \n\t"
"mov %1, %k6 \n\t"
@@ -138,13 +138,12 @@ static int decode_significance_8x8_x86(CABACContext *c,
"addl %8, %k0 \n\t"
"shr $2, %k0 \n\t"
:"=&q"(coeff_count),"+m"(last), "+m"(index), "+&r"(c->low), "=&r"(bit),
- "+&r"(c->range), "=&r"(state)
- :"r"(c), "m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off), "m"(last_coeff_ctx_base),
- "i"(offsetof(CABACContext, bytestream))
+ "+&r"(c->range), "=&r"(state), "+m"(c->bytestream)
+ :"m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off), "m"(last_coeff_ctx_base)
: "%"REG_c, "memory"
);
return coeff_count;
}
-#endif /* HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */
+#endif /* HAVE_6REGS && !defined(BROKEN_RELOCATIONS) */
#endif /* AVCODEC_X86_H264_I386_H */
diff --git a/libavcodec/x86/vc1dsp_yasm.asm b/libavcodec/x86/vc1dsp_yasm.asm
index 572aa0be1e..1eba3c1198 100644
--- a/libavcodec/x86/vc1dsp_yasm.asm
+++ b/libavcodec/x86/vc1dsp_yasm.asm
@@ -227,7 +227,7 @@ section .text
imul r2, 0x01010101
%endmacro
-; I dont know why the sign extension is needed...
+; I do not know why the sign extension is needed...
%macro PSIGNW_SRA_MMX 2
psraw %2, 15
PSIGNW_MMX %1, %2
diff --git a/libavdevice/jack_audio.c b/libavdevice/jack_audio.c
index b1077c4ebe..d0a09ee218 100644
--- a/libavdevice/jack_audio.c
+++ b/libavdevice/jack_audio.c
@@ -272,7 +272,7 @@ static int audio_read_packet(AVFormatContext *context, AVPacket *pkt)
}
}
- /* Wait for a packet comming back from process_callback(), if one isn't available yet */
+ /* Wait for a packet coming back from process_callback(), if one isn't available yet */
timeout.tv_sec = av_gettime() / 1000000 + 2;
if (sem_timedwait(&self->packet_count, &timeout)) {
if (errno == ETIMEDOUT) {
diff --git a/libavdevice/timefilter.h b/libavdevice/timefilter.h
index 4580904092..2a77946e99 100644
--- a/libavdevice/timefilter.h
+++ b/libavdevice/timefilter.h
@@ -72,7 +72,7 @@ TimeFilter * ff_timefilter_new(double clock_period, double feedback2_factor, dou
*
* system_time, in seconds, should be the value of the system clock time,
* at (or as close as possible to) the moment the device hardware interrupt
- * occured (or any other event the device clock raises at the beginning of a
+ * occurred (or any other event the device clock raises at the beginning of a
* cycle).
*
* @return the filtered time, in seconds
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 03ce4ca056..3d9c5aea12 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -28,7 +28,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
@@ -131,7 +131,7 @@ static int fourxm_read_header(AVFormatContext *s,
size = AV_RL32(&header[i + 4]);
if (fourcc_tag == std__TAG) {
- fourxm->fps = av_int2flt(AV_RL32(&header[i + 12]));
+ fourxm->fps = av_int2float(AV_RL32(&header[i + 12]));
} else if (fourcc_tag == vtrk_TAG) {
/* check that there is enough data */
if (size != vtrk_SIZE) {
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 66f8eefc75..e33bd57b7f 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/mathematics.h"
#include "libavutil/dict.h"
#include "avformat.h"
#include "internal.h"
@@ -90,7 +90,8 @@ static void get_meta(AVFormatContext *s, const char *key, int size)
static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec,
int size, unsigned version)
{
- AVExtFloat ext;
+ int exp;
+ uint64_t val;
double sample_rate;
unsigned int num_frames;
@@ -101,8 +102,9 @@ static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec,
num_frames = avio_rb32(pb);
codec->bits_per_coded_sample = avio_rb16(pb);
- avio_read(pb, (uint8_t*)&ext, sizeof(ext));/* Sample rate is in */
- sample_rate = av_ext2dbl(ext); /* 80 bits BE IEEE extended float */
+ exp = avio_rb16(pb);
+ val = avio_rb64(pb);
+ sample_rate = ldexp(val, exp - 16383 - 63);
codec->sample_rate = sample_rate;
size -= 18;
diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index 9a4f41b3f3..e5c38b1547 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
#include "aiff.h"
@@ -37,7 +37,7 @@ static int aiff_write_header(AVFormatContext *s)
AIFFOutputContext *aiff = s->priv_data;
AVIOContext *pb = s->pb;
AVCodecContext *enc = s->streams[0]->codec;
- AVExtFloat sample_rate;
+ uint64_t sample_rate;
int aifc = 0;
/* First verify if format is ok */
@@ -89,8 +89,9 @@ static int aiff_write_header(AVFormatContext *s)
avio_wb16(pb, enc->bits_per_coded_sample); /* Sample size */
- sample_rate = av_dbl2ext((double)enc->sample_rate);
- avio_write(pb, (uint8_t*)&sample_rate, sizeof(sample_rate));
+ sample_rate = av_double2int(enc->sample_rate);
+ avio_wb16(pb, (sample_rate >> 52) + (16383 - 1023));
+ avio_wb64(pb, UINT64_C(1) << 63 | sample_rate << 11);
if (aifc) {
avio_wl32(pb, enc->codec_tag);
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 1f3506d158..340965955f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -697,7 +697,8 @@ typedef struct AVStream {
/**
* last packet in packet_buffer for this stream when muxing.
- * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav*
+ * Used internally, NOT PART OF PUBLIC API, do not read or
+ * write from outside of libav*
*/
struct AVPacketList *last_in_packet_buffer;
#endif
@@ -731,7 +732,7 @@ typedef struct AVStream {
int64_t interleaver_chunk_duration;
/**
- * Stream informations used internally by av_find_stream_info()
+ * Stream information used internally by av_find_stream_info()
*/
#define MAX_STD_TIMEBASES (60*12+5)
struct {
@@ -909,7 +910,7 @@ typedef struct AVFormatContext {
/**
* Decoding: duration of the stream, in AV_TIME_BASE fractional
* seconds. Only set this value if you know none of the individual stream
- * durations and also dont set any of them. This is deduced from the
+ * durations and also do not set any of them. This is deduced from the
* AVStream values if not set.
*/
int64_t duration;
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 89b2bd3883..3294f0639e 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -30,7 +30,7 @@
#include "riff.h"
#include "isom.h"
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/dict.h"
#include "caf.h"
@@ -68,7 +68,7 @@ static int read_desc_chunk(AVFormatContext *s)
/* parse format description */
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->codec->sample_rate = av_int2dbl(avio_rb64(pb));
+ st->codec->sample_rate = av_int2double(avio_rb64(pb));
st->codec->codec_tag = avio_rl32(pb);
flags = avio_rb32(pb);
caf->bytes_per_packet = avio_rb32(pb);
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 86e31cc0af..2b7ae7ed35 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
#include "ffm.h"
@@ -329,10 +329,10 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->rc_max_rate = avio_rb32(pb);
codec->rc_min_rate = avio_rb32(pb);
codec->rc_buffer_size = avio_rb32(pb);
- codec->i_quant_factor = av_int2dbl(avio_rb64(pb));
- codec->b_quant_factor = av_int2dbl(avio_rb64(pb));
- codec->i_quant_offset = av_int2dbl(avio_rb64(pb));
- codec->b_quant_offset = av_int2dbl(avio_rb64(pb));
+ codec->i_quant_factor = av_int2double(avio_rb64(pb));
+ codec->b_quant_factor = av_int2double(avio_rb64(pb));
+ codec->i_quant_offset = av_int2double(avio_rb64(pb));
+ codec->b_quant_offset = av_int2double(avio_rb64(pb));
codec->dct_algo = avio_rb32(pb);
codec->strict_std_compliance = avio_rb32(pb);
codec->max_b_frames = avio_rb32(pb);
@@ -344,7 +344,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->mb_decision = avio_rb32(pb);
codec->nsse_weight = avio_rb32(pb);
codec->frame_skip_cmp = avio_rb32(pb);
- codec->rc_buffer_aggressivity = av_int2dbl(avio_rb64(pb));
+ codec->rc_buffer_aggressivity = av_int2double(avio_rb64(pb));
codec->codec_tag = avio_rb32(pb);
codec->thread_count = avio_r8(pb);
codec->coder_type = avio_rb32(pb);
@@ -355,8 +355,8 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->keyint_min = avio_rb32(pb);
codec->scenechange_threshold = avio_rb32(pb);
codec->b_frame_strategy = avio_rb32(pb);
- codec->qcompress = av_int2dbl(avio_rb64(pb));
- codec->qblur = av_int2dbl(avio_rb64(pb));
+ codec->qcompress = av_int2double(avio_rb64(pb));
+ codec->qblur = av_int2double(avio_rb64(pb));
codec->max_qdiff = avio_rb32(pb);
codec->refs = avio_rb32(pb);
codec->directpred = avio_rb32(pb);
diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
index 1f65cac017..7378808567 100644
--- a/libavformat/ffmenc.c
+++ b/libavformat/ffmenc.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
#include "ffm.h"
@@ -137,10 +137,10 @@ static int ffm_write_header(AVFormatContext *s)
avio_wb32(pb, codec->rc_max_rate);
avio_wb32(pb, codec->rc_min_rate);
avio_wb32(pb, codec->rc_buffer_size);
- avio_wb64(pb, av_dbl2int(codec->i_quant_factor));
- avio_wb64(pb, av_dbl2int(codec->b_quant_factor));
- avio_wb64(pb, av_dbl2int(codec->i_quant_offset));
- avio_wb64(pb, av_dbl2int(codec->b_quant_offset));
+ avio_wb64(pb, av_double2int(codec->i_quant_factor));
+ avio_wb64(pb, av_double2int(codec->b_quant_factor));
+ avio_wb64(pb, av_double2int(codec->i_quant_offset));
+ avio_wb64(pb, av_double2int(codec->b_quant_offset));
avio_wb32(pb, codec->dct_algo);
avio_wb32(pb, codec->strict_std_compliance);
avio_wb32(pb, codec->max_b_frames);
@@ -152,7 +152,7 @@ static int ffm_write_header(AVFormatContext *s)
avio_wb32(pb, codec->mb_decision);
avio_wb32(pb, codec->nsse_weight);
avio_wb32(pb, codec->frame_skip_cmp);
- avio_wb64(pb, av_dbl2int(codec->rc_buffer_aggressivity));
+ avio_wb64(pb, av_double2int(codec->rc_buffer_aggressivity));
avio_wb32(pb, codec->codec_tag);
avio_w8(pb, codec->thread_count);
avio_wb32(pb, codec->coder_type);
@@ -163,8 +163,8 @@ static int ffm_write_header(AVFormatContext *s)
avio_wb32(pb, codec->keyint_min);
avio_wb32(pb, codec->scenechange_threshold);
avio_wb32(pb, codec->b_frame_strategy);
- avio_wb64(pb, av_dbl2int(codec->qcompress));
- avio_wb64(pb, av_dbl2int(codec->qblur));
+ avio_wb64(pb, av_double2int(codec->qcompress));
+ avio_wb64(pb, av_double2int(codec->qblur));
avio_wb32(pb, codec->max_qdiff);
avio_wb32(pb, codec->refs);
avio_wb32(pb, codec->directpred);
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 0699f544b5..34945299b6 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -26,7 +26,7 @@
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/mpeg4audio.h"
@@ -187,7 +187,7 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream
for (i = 0; i < arraylen && avio_tell(ioc) < max_pos - 1; i++) {
if (avio_r8(ioc) != AMF_DATA_TYPE_NUMBER)
goto finish;
- current_array[0][i] = av_int2dbl(avio_rb64(ioc));
+ current_array[0][i] = av_int2double(avio_rb64(ioc));
}
if (times && filepositions) {
// 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
switch(amf_type) {
case AMF_DATA_TYPE_NUMBER:
- num_val = av_int2dbl(avio_rb64(ioc)); break;
+ num_val = av_int2double(avio_rb64(ioc)); break;
case AMF_DATA_TYPE_BOOL:
num_val = avio_r8(ioc); break;
case AMF_DATA_TYPE_STRING:
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 2a223eeeb3..2384e81276 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "flv.h"
#include "internal.h"
@@ -165,7 +165,7 @@ static void put_avc_eos_tag(AVIOContext *pb, unsigned ts) {
static void put_amf_double(AVIOContext *pb, double d)
{
avio_w8(pb, AMF_DATA_TYPE_NUMBER);
- avio_wb64(pb, av_dbl2int(d));
+ avio_wb64(pb, av_double2int(d));
}
static void put_amf_bool(AVIOContext *pb, int b) {
@@ -380,7 +380,7 @@ static int flv_write_trailer(AVFormatContext *s)
file_size = avio_tell(pb);
- /* update informations */
+ /* update information */
avio_seek(pb, flv->duration_offset, SEEK_SET);
put_amf_double(pb, flv->duration / (double)1000);
avio_seek(pb, flv->filesize_offset, SEEK_SET);
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index 02047c68d5..47b64efc9f 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/opt.h"
#include "libavutil/mathematics.h"
#include "libavcodec/timecode.h"
@@ -551,8 +551,8 @@ static int gxf_write_umf_media_dv(AVIOContext *pb, GXFStreamContext *sc)
static int gxf_write_umf_media_audio(AVIOContext *pb, GXFStreamContext *sc)
{
- avio_wl64(pb, av_dbl2int(1)); /* sound level to begin to */
- avio_wl64(pb, av_dbl2int(1)); /* sound level to begin to */
+ avio_wl64(pb, av_double2int(1)); /* sound level to begin to */
+ avio_wl64(pb, av_double2int(1)); /* sound level to begin to */
avio_wl32(pb, 0); /* number of fields over which to ramp up sound level */
avio_wl32(pb, 0); /* number of fields over which to ramp down sound level */
avio_wl32(pb, 0); /* reserved */
diff --git a/libavformat/http.c b/libavformat/http.c
index f7e0b5cc8c..5d19c6e007 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -70,7 +70,7 @@ static const AVClass flavor ## _context_class = {\
.item_name = av_default_item_name,\
.option = options,\
.version = LIBAVUTIL_VERSION_INT,\
-};
+}
HTTP_CLASS(http);
HTTP_CLASS(https);
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index f0a21977ef..37143b53ad 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -149,7 +149,7 @@ static void free_geobtag(void *obj)
* @param maxread Pointer to maximum number of characters to read from the
* AVIOContext. After execution the value is decremented by the number of bytes
* actually read.
- * @returns 0 if no error occured, dst is uninitialized on error
+ * @returns 0 if no error occurred, dst is uninitialized on error
*/
static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
uint8_t **dst, int *maxread)
diff --git a/libavformat/img2.c b/libavformat/img2.c
index 98397f4dcb..bc35591a0b 100644
--- a/libavformat/img2.c
+++ b/libavformat/img2.c
@@ -446,7 +446,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
(!st->codec->extradata_size &&
AV_RL32(pkt->data+4) != MKTAG('j','P',' ',' '))){ // signature
error:
- av_log(s, AV_LOG_ERROR, "malformated jpeg2000 codestream %X\n", AV_RB32(pkt->data));
+ av_log(s, AV_LOG_ERROR, "malformed JPEG 2000 codestream %X\n", AV_RB32(pkt->data));
return -1;
}
}
diff --git a/libavformat/iv8.c b/libavformat/iv8.c
index b1b40929a3..fa77f82471 100644
--- a/libavformat/iv8.c
+++ b/libavformat/iv8.c
@@ -24,7 +24,7 @@
static int probe(AVProbeData *p)
{
- // the single file i have starts with that, i dont know if others do too
+ // the single file I have starts with that, I do not know if others do, too
if( p->buf[0] == 1
&& p->buf[1] == 1
&& p->buf[2] == 3
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 4a0c2fa76c..fd1001ef8e 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -38,7 +38,7 @@
#include "rm.h"
#include "matroska.h"
#include "libavcodec/mpeg4audio.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/avstring.h"
#include "libavutil/lzo.h"
@@ -652,9 +652,9 @@ static int ebml_read_float(AVIOContext *pb, int size, double *num)
if (size == 0) {
*num = 0;
} else if (size == 4) {
- *num= av_int2flt(avio_rb32(pb));
- } else if(size==8){
- *num= av_int2dbl(avio_rb64(pb));
+ *num = av_int2float(avio_rb32(pb));
+ } else if (size == 8){
+ *num = av_int2double(avio_rb64(pb));
} else
return AVERROR_INVALIDDATA;
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index b8c4667a4e..e74366fe95 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -29,7 +29,7 @@
#include "avlanguage.h"
#include "libavutil/samplefmt.h"
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/random_seed.h"
#include "libavutil/lfg.h"
@@ -185,7 +185,7 @@ static void put_ebml_float(AVIOContext *pb, unsigned int elementid, double val)
{
put_ebml_id(pb, elementid);
put_ebml_num(pb, 8, 0);
- avio_wb64(pb, av_dbl2int(val));
+ avio_wb64(pb, av_double2int(val));
}
static void put_ebml_binary(AVIOContext *pb, unsigned int elementid,
diff --git a/libavformat/mms.h b/libavformat/mms.h
index 0117089d24..cbfa79a838 100644
--- a/libavformat/mms.h
+++ b/libavformat/mms.h
@@ -33,7 +33,7 @@ typedef struct {
/** Buffer for outgoing packets. */
/*@{*/
- uint8_t *write_out_ptr; ///< Pointer for writting the buffer.
+ uint8_t *write_out_ptr; ///< Pointer for writing the buffer.
uint8_t out_buffer[512]; ///< Buffer for outgoing packet.
/*@}*/
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 12af19ed50..7b41ec4414 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -26,7 +26,7 @@
//#define MOV_EXPORT_ALL_METADATA
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
@@ -1261,7 +1261,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
avio_rb32(pb); /* bytes per sample */
} else if (version==2) {
avio_rb32(pb); /* sizeof struct only */
- st->codec->sample_rate = av_int2dbl(avio_rb64(pb)); /* float 64 */
+ st->codec->sample_rate = av_int2double(avio_rb64(pb)); /* float 64 */
st->codec->channels = avio_rb32(pb);
avio_rb32(pb); /* always 0x7F000000 */
st->codec->bits_per_coded_sample = avio_rb32(pb); /* bits per channel if sound is uncompressed */
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 181965f720..610a1fcff3 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -32,7 +32,7 @@
#include "libavcodec/put_bits.h"
#include "internal.h"
#include "libavutil/avstring.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"
@@ -250,7 +250,7 @@ static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track)
/**
* This function writes extradata "as is".
- * Extradata must be formated like a valid atom (with size and tag)
+ * Extradata must be formatted like a valid atom (with size and tag).
*/
static int mov_write_extradata_tag(AVIOContext *pb, MOVTrack *track)
{
@@ -484,7 +484,7 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
avio_wb16(pb, 0);
avio_wb32(pb, 0x00010000);
avio_wb32(pb, 72);
- avio_wb64(pb, av_dbl2int(track->timescale));
+ avio_wb64(pb, av_double2int(track->timescale));
avio_wb32(pb, track->enc->channels);
avio_wb32(pb, 0x7F000000);
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)
avio_wb32(pb, track->enc->height << 16);
return updateSize(pb, pos);
-};
+}
// This box seems important for the psp playback ... without it the movie seems to hang
static int mov_write_edts_tag(AVIOContext *pb, MOVTrack *track)
@@ -2206,6 +2206,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
AVCodecContext *enc = trk->enc;
unsigned int samplesInChunk = 0;
int size= pkt->size;
+ uint8_t *reformatted_data = NULL;
if (!s->pb->seekable) return 0; /* Can't handle that */
if (!size) return 0; /* Discard 0 sized packets */
@@ -2255,13 +2256,23 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
if(mov->frag_seq_num>0){
uint8_t *buf=NULL;
size= pkt->size;
+
if(ff_avc_parse_nal_units_buf(pkt->data, &buf, &size) < 0){
av_log(s, AV_LOG_ERROR, "malformated H264 bitstream\n");
return -1;
}
trk->cluster[trk->entry].data= buf;
- }else
+ if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) {
+ reformatted_data= av_malloc(size);
+ memcpy(reformatted_data, buf, size);
+ }
+ }else if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) {
+ ff_avc_parse_nal_units_buf(pkt->data, &reformatted_data,
+ &size);
+ avio_write(pb, reformatted_data, size);
+ } else {
size = ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
+ }
} else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 &&
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
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)
avio_flush(pb);
if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams)
- ff_mov_add_hinted_packet(s, pkt, trk->hint_track, trk->entry);
+ ff_mov_add_hinted_packet(s, pkt, trk->hint_track, trk->entry,
+ reformatted_data, size);
+ av_free(reformatted_data);
return 0;
}
diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index e0ed6e6516..356421c7db 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -131,7 +131,8 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt);
int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index);
int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
- int track_index, int sample);
+ int track_index, int sample,
+ uint8_t *sample_data, int sample_size);
void ff_mov_close_hinting(MOVTrack *track);
#endif /* AVFORMAT_MOVENC_H */
diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c
index 8e96355abc..bb55f73053 100644
--- a/libavformat/movenchint.c
+++ b/libavformat/movenchint.c
@@ -95,11 +95,12 @@ static void sample_queue_free(HintSampleQueue *queue)
* not copied. sample_queue_retain should be called before pkt->data
* is reused/freed.
*/
-static void sample_queue_push(HintSampleQueue *queue, AVPacket *pkt, int sample)
+static void sample_queue_push(HintSampleQueue *queue, uint8_t *data, int size,
+ int sample)
{
/* No need to keep track of smaller samples, since describing them
* with immediates is more efficient. */
- if (pkt->size <= 14)
+ if (size <= 14)
return;
if (!queue->samples || queue->len >= queue->size) {
HintSample* samples;
@@ -109,8 +110,8 @@ static void sample_queue_push(HintSampleQueue *queue, AVPacket *pkt, int sample)
return;
queue->samples = samples;
}
- queue->samples[queue->len].data = pkt->data;
- queue->samples[queue->len].size = pkt->size;
+ queue->samples[queue->len].data = data;
+ queue->samples[queue->len].size = size;
queue->samples[queue->len].sample_number = sample;
queue->samples[queue->len].offset = 0;
queue->samples[queue->len].own_data = 0;
@@ -386,7 +387,8 @@ static int write_hint_packets(AVIOContext *out, const uint8_t *data,
}
int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
- int track_index, int sample)
+ int track_index, int sample,
+ uint8_t *sample_data, int sample_size)
{
MOVMuxContext *mov = s->priv_data;
MOVTrack *trk = &mov->tracks[track_index];
@@ -402,7 +404,10 @@ int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
if (!rtp_ctx->pb)
return AVERROR(ENOMEM);
- sample_queue_push(&trk->sample_queue, pkt, sample);
+ if (sample_data)
+ sample_queue_push(&trk->sample_queue, sample_data, sample_size, sample);
+ else
+ sample_queue_push(&trk->sample_queue, pkt->data, pkt->size, sample);
/* Feed the packet to the RTP muxer */
ff_write_chained(rtp_ctx, 0, pkt, s);
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 8d026fd372..a8871cc576 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1939,7 +1939,7 @@ static int mpegts_read_header(AVFormatContext *s,
if (s->iformat == &ff_mpegts_demuxer) {
/* normal demux */
- /* first do a scanning to get all the services */
+ /* first do a scan to get all the services */
/* NOTE: We attempt to seek on non-seekable files as well, as the
* probe buffer usually is big enough. Only warn if the seek failed
* on files where the seek should work. */
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index b75eff73c0..3ace64bdd5 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -979,7 +979,7 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
uint32_t state = -1;
if (pkt->size < 5 || AV_RB32(pkt->data) != 0x0000001) {
- av_log(s, AV_LOG_ERROR, "h264 bitstream malformated, "
+ av_log(s, AV_LOG_ERROR, "H.264 bitstream malformed, "
"no startcode found, use -vbsf h264_mp4toannexb\n");
return -1;
}
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 0b62a5a851..c209c5c5e5 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -70,7 +70,7 @@ typedef struct {
int index; ///< index in mxf_essence_container_uls table
const UID *codec_ul;
int order; ///< interleaving order if dts are equal
- int interlaced; ///< wether picture is interlaced
+ int interlaced; ///< whether picture is interlaced
int temporal_reordering;
AVRational aspect_ratio; ///< display aspect ratio
int closed_gop; ///< gop is closed, used in mpeg-2 frame parsing
diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index c421ca98f4..93cbc264c3 100644
--- a/libavformat/nuv.c
+++ b/libavformat/nuv.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
#include "riff.h"
@@ -140,10 +140,10 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
avio_rl32(pb); // unused, "desiredheight"
avio_r8(pb); // 'P' == progressive, 'I' == interlaced
avio_skip(pb, 3); // padding
- aspect = av_int2dbl(avio_rl64(pb));
+ aspect = av_int2double(avio_rl64(pb));
if (aspect > 0.9999 && aspect < 1.0001)
aspect = 4.0 / 3.0;
- fps = av_int2dbl(avio_rl64(pb));
+ fps = av_int2double(avio_rl64(pb));
// number of packets per stream type, -1 means unknown, e.g. streaming
v_packs = avio_rl32(pb);
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index 947ba80b54..a367ab1265 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -484,7 +484,7 @@ real_parse_asm_rulebook(AVFormatContext *s, AVStream *orig_st,
* is set and once for if it isn't. We only read the first because we
* don't care much (that's what the "odd" variable is for).
* Each rule contains a set of one or more statements, optionally
- * preceeded by a single condition. If there's a condition, the rule
+ * preceded by a single condition. If there's a condition, the rule
* starts with a '#'. Multiple conditions are merged between brackets,
* so there are never multiple conditions spread out over separate
* statements. Generally, these conditions are bitrate limits (min/max)
diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c
index 7e2ccdc6ac..61e159b06a 100644
--- a/libavformat/rtmppkt.c
+++ b/libavformat/rtmppkt.c
@@ -21,7 +21,7 @@
#include "libavcodec/bytestream.h"
#include "libavutil/avstring.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "rtmppkt.h"
@@ -37,7 +37,7 @@ void ff_amf_write_bool(uint8_t **dst, int val)
void ff_amf_write_number(uint8_t **dst, double val)
{
bytestream_put_byte(dst, AMF_DATA_TYPE_NUMBER);
- bytestream_put_be64(dst, av_dbl2int(val));
+ bytestream_put_be64(dst, av_double2int(val));
}
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,
if (size == namelen && !memcmp(data-size, name, namelen)) {
switch (*data++) {
case AMF_DATA_TYPE_NUMBER:
- snprintf(dst, dst_size, "%g", av_int2dbl(AV_RB64(data)));
+ snprintf(dst, dst_size, "%g", av_int2double(AV_RB64(data)));
break;
case AMF_DATA_TYPE_BOOL:
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
return;
switch (*data++) {
case AMF_DATA_TYPE_NUMBER:
- av_log(ctx, AV_LOG_DEBUG, " number %g\n", av_int2dbl(AV_RB64(data)));
+ av_log(ctx, AV_LOG_DEBUG, " number %g\n", av_int2double(AV_RB64(data)));
return;
case AMF_DATA_TYPE_BOOL:
av_log(ctx, AV_LOG_DEBUG, " bool %d\n", *data);
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 8aec9f32ce..4fe1d33274 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -26,7 +26,7 @@
#include "libavcodec/bytestream.h"
#include "libavutil/avstring.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/lfg.h"
#include "libavutil/sha.h"
#include "avformat.h"
@@ -615,7 +615,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
/* hack for Wowza Media Server, it does not send result for
* releaseStream and FCPublish calls */
if (!pkt->data[10]) {
- int pkt_id = (int) av_int2dbl(AV_RB64(pkt->data + 11));
+ int pkt_id = av_int2double(AV_RB64(pkt->data + 11));
if (pkt_id == rt->create_stream_invoke)
rt->state = STATE_CONNECTING;
}
@@ -626,7 +626,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
if (pkt->data[10] || pkt->data[19] != 5 || pkt->data[20]) {
av_log(s, AV_LOG_WARNING, "Unexpected reply on connect()\n");
} else {
- rt->main_channel_id = (int) av_int2dbl(AV_RB64(pkt->data + 21));
+ rt->main_channel_id = av_int2double(AV_RB64(pkt->data + 21));
}
if (rt->is_input) {
gen_play(s, rt);
diff --git a/libavformat/rtp.h b/libavformat/rtp.h
index 5297e17f6a..23588755ec 100644
--- a/libavformat/rtp.h
+++ b/libavformat/rtp.h
@@ -72,7 +72,7 @@ enum CodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type);
#define RTP_VERSION 2
#define RTP_MAX_SDES 256 /**< maximum text length for SDES */
-/* RTCP paquets use 0.5 % of the bandwidth */
+/* RTCP packets use 0.5% of the bandwidth */
#define RTCP_TX_RATIO_NUM 5
#define RTCP_TX_RATIO_DEN 1000
diff --git a/libavformat/rtpenc_h264.c b/libavformat/rtpenc_h264.c
index 11074d0d51..86930bbac1 100644
--- a/libavformat/rtpenc_h264.c
+++ b/libavformat/rtpenc_h264.c
@@ -33,18 +33,15 @@ static const uint8_t *avc_mp4_find_startcode(const uint8_t *start, const uint8_t
{
int res = 0;
- if (end - start < nal_length_size) {
+ if (end - start < nal_length_size)
return NULL;
- }
- while (nal_length_size--) {
+ while (nal_length_size--)
res = (res << 8) | *start++;
- }
- if (end - start < res) {
+ if (start + res > end || res < 0 || start + res < start)
return NULL;
- }
- return res + start;
+ return start + res;
}
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
void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size)
{
- const uint8_t *r;
+ const uint8_t *r, *end = buf1 + size;
RTPMuxContext *s = s1->priv_data;
s->timestamp = s->cur_timestamp;
- 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);
- while (r < buf1 + size) {
+ if (s->nal_length_size)
+ r = avc_mp4_find_startcode(buf1, end, s->nal_length_size) ? buf1 : end;
+ else
+ r = ff_avc_find_startcode(buf1, end);
+ while (r < end) {
const uint8_t *r1;
if (s->nal_length_size) {
- r1 = avc_mp4_find_startcode(r, buf1 + size, s->nal_length_size);
- if (!r1) {
- r1 = buf1 + size;
- }
+ r1 = avc_mp4_find_startcode(r, end, s->nal_length_size);
+ if (!r1)
+ r1 = end;
r += s->nal_length_size;
} else {
- while(!*(r++));
- r1 = ff_avc_find_startcode(r, buf1 + size);
+ while (!*(r++));
+ r1 = ff_avc_find_startcode(r, end);
}
- nal_send(s1, r, r1 - r, (r1 == buf1 + size));
+ nal_send(s1, r, r1 - r, r1 == end);
r = r1;
}
}
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 5def15d2a3..11b50a0d07 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -156,6 +156,8 @@ static char *extradata2psets(AVCodecContext *c)
char *psets, *p;
const uint8_t *r;
const char *pset_string = "; sprop-parameter-sets=";
+ uint8_t *orig_extradata = NULL;
+ int orig_extradata_size = 0;
if (c->extradata_size > MAX_EXTRADATA_SIZE) {
av_log(c, AV_LOG_ERROR, "Too much extradata!\n");
@@ -172,6 +174,15 @@ static char *extradata2psets(AVCodecContext *c)
return NULL;
}
+
+ orig_extradata_size = c->extradata_size;
+ orig_extradata = av_mallocz(orig_extradata_size +
+ FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!orig_extradata) {
+ av_bitstream_filter_close(bsfc);
+ return NULL;
+ }
+ memcpy(orig_extradata, c->extradata, orig_extradata_size);
av_bitstream_filter_filter(bsfc, c, NULL, &dummy_p, &dummy_int, NULL, 0, 0);
av_bitstream_filter_close(bsfc);
}
@@ -179,6 +190,7 @@ static char *extradata2psets(AVCodecContext *c)
psets = av_mallocz(MAX_PSET_SIZE);
if (psets == NULL) {
av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the parameter sets.\n");
+ av_free(orig_extradata);
return NULL;
}
memcpy(psets, pset_string, strlen(pset_string));
@@ -208,6 +220,11 @@ static char *extradata2psets(AVCodecContext *c)
p += strlen(p);
r = r1;
}
+ if (orig_extradata) {
+ av_free(c->extradata);
+ c->extradata = orig_extradata;
+ c->extradata_size = orig_extradata_size;
+ }
return psets;
}
diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c
index 45607ec666..ad8f488961 100644
--- a/libavformat/soxdec.c
+++ b/libavformat/soxdec.c
@@ -30,7 +30,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/dict.h"
#include "avformat.h"
#include "internal.h"
@@ -62,14 +62,14 @@ static int sox_read_header(AVFormatContext *s,
st->codec->codec_id = CODEC_ID_PCM_S32LE;
header_size = avio_rl32(pb);
avio_skip(pb, 8); /* sample count */
- sample_rate = av_int2dbl(avio_rl64(pb));
+ sample_rate = av_int2double(avio_rl64(pb));
st->codec->channels = avio_rl32(pb);
comment_size = avio_rl32(pb);
} else {
st->codec->codec_id = CODEC_ID_PCM_S32BE;
header_size = avio_rb32(pb);
avio_skip(pb, 8); /* sample count */
- sample_rate = av_int2dbl(avio_rb64(pb));
+ sample_rate = av_int2double(avio_rb64(pb));
st->codec->channels = avio_rb32(pb);
comment_size = avio_rb32(pb);
}
diff --git a/libavformat/soxenc.c b/libavformat/soxenc.c
index a8549b0ffa..811cb0e97d 100644
--- a/libavformat/soxenc.c
+++ b/libavformat/soxenc.c
@@ -30,7 +30,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/dict.h"
#include "avformat.h"
#include "avio_internal.h"
@@ -59,14 +59,14 @@ static int sox_write_header(AVFormatContext *s)
ffio_wfourcc(pb, ".SoX");
avio_wl32(pb, sox->header_size);
avio_wl64(pb, 0); /* number of samples */
- avio_wl64(pb, av_dbl2int(enc->sample_rate));
+ avio_wl64(pb, av_double2int(enc->sample_rate));
avio_wl32(pb, enc->channels);
avio_wl32(pb, comment_size);
} else if (enc->codec_id == CODEC_ID_PCM_S32BE) {
ffio_wfourcc(pb, "XoS.");
avio_wb32(pb, sox->header_size);
avio_wb64(pb, 0); /* number of samples */
- avio_wb64(pb, av_dbl2int(enc->sample_rate));
+ avio_wb64(pb, av_double2int(enc->sample_rate));
avio_wb32(pb, enc->channels);
avio_wb32(pb, comment_size);
} else {
diff --git a/libavformat/thp.c b/libavformat/thp.c
index 96f9ba115c..cd50917105 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
@@ -69,7 +69,7 @@ static int thp_read_header(AVFormatContext *s,
avio_rb32(pb); /* Max buf size. */
avio_rb32(pb); /* Max samples. */
- thp->fps = av_d2q(av_int2flt(avio_rb32(pb)), INT_MAX);
+ thp->fps = av_d2q(av_int2float(avio_rb32(pb)), INT_MAX);
thp->framecnt = avio_rb32(pb);
thp->first_framesz = avio_rb32(pb);
avio_rb32(pb); /* Data size. */
diff --git a/libavformat/udp.c b/libavformat/udp.c
index a0d127c614..281f5158b3 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -452,7 +452,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
goto fail;
/* Follow the requested reuse option, unless it's multicast in which
- * case enable reuse unless explicitely disabled.
+ * case enable reuse unless explicitly disabled.
*/
if (s->reuse_socket || (s->is_multicast && !reuse_specified)) {
s->reuse_socket = 1;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3e5a7b76dd..82cc99515a 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1123,7 +1123,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i+1]);
if(pkt->dts == AV_NOPTS_VALUE)
pkt->dts= st->pts_buffer[0];
- if(st->codec->codec_id == CODEC_ID_H264){ //we skiped it above so we try here
+ if(st->codec->codec_id == CODEC_ID_H264){ // we skipped it above so we try here
update_initial_timestamps(s, pkt->stream_index, pkt->dts, pkt->pts); // this should happen on the first packet
}
if(pkt->dts > st->cur_dts)
diff --git a/libavutil/eval.h b/libavutil/eval.h
index ee378a29b4..22fa121127 100644
--- a/libavutil/eval.h
+++ b/libavutil/eval.h
@@ -58,7 +58,7 @@ int av_expr_parse_and_eval(double *res, const char *s,
* Parse an expression.
*
* @param expr a pointer where is put an AVExpr containing the parsed
- * value in case of successfull parsing, or NULL otherwise.
+ * value in case of successful parsing, or NULL otherwise.
* The pointed to AVExpr must be freed with av_expr_free() by the user
* when it is not needed anymore.
* @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
diff --git a/libavutil/intfloat.h b/libavutil/intfloat.h
new file mode 100644
index 0000000000..9db624a6ce
--- /dev/null
+++ b/libavutil/intfloat.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2011 Mans Rullgard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_INTFLOAT_H
+#define AVUTIL_INTFLOAT_H
+
+#include <stdint.h>
+#include "attributes.h"
+
+union av_intfloat32 {
+ uint32_t i;
+ float f;
+};
+
+union av_intfloat64 {
+ uint64_t i;
+ double f;
+};
+
+/**
+ * Reinterpret a 32-bit integer as a float.
+ */
+static av_always_inline float av_int2float(uint32_t i)
+{
+ union av_intfloat32 v = { .i = i };
+ return v.f;
+}
+
+/**
+ * Reinterpret a float as a 32-bit integer.
+ */
+static av_always_inline uint32_t av_float2int(float f)
+{
+ union av_intfloat32 v = { .f = f };
+ return v.i;
+}
+
+/**
+ * Reinterpret a 64-bit integer as a double.
+ */
+static av_always_inline double av_int2double(uint64_t i)
+{
+ union av_intfloat64 v = { .i = i };
+ return v.f;
+}
+
+/**
+ * Reinterpret a double as a 64-bit integer.
+ */
+static av_always_inline uint64_t av_double2int(double f)
+{
+ union av_intfloat64 v = { .f = f };
+ return v.i;
+}
+
+#endif /* AVUTIL_INTFLOAT_H */
diff --git a/libavutil/intfloat_readwrite.h b/libavutil/intfloat_readwrite.h
index 1b80fc6e95..9709f4dae4 100644
--- a/libavutil/intfloat_readwrite.h
+++ b/libavutil/intfloat_readwrite.h
@@ -30,11 +30,11 @@ typedef struct AVExtFloat {
uint8_t mantissa[8];
} AVExtFloat;
-double av_int2dbl(int64_t v) av_const;
-float av_int2flt(int32_t v) av_const;
-double av_ext2dbl(const AVExtFloat ext) av_const;
-int64_t av_dbl2int(double d) av_const;
-int32_t av_flt2int(float d) av_const;
-AVExtFloat av_dbl2ext(double d) av_const;
+attribute_deprecated double av_int2dbl(int64_t v) av_const;
+attribute_deprecated float av_int2flt(int32_t v) av_const;
+attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const;
+attribute_deprecated int64_t av_dbl2int(double d) av_const;
+attribute_deprecated int32_t av_flt2int(float d) av_const;
+attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const;
#endif /* AVUTIL_INTFLOAT_READWRITE_H */
diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index 983b65effe..22cbe25a2e 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -912,7 +912,7 @@ static void reallocBuffers(PPContext *c, int width, int height, int stride, int
c->yHistogram[i]= width*height/64*15/256;
for(i=0; i<3; i++){
- //Note: The +17*1024 is just there so i do not have to worry about r/w over the end.
+ //Note: The +17*1024 is just there so I do not have to worry about r/w over the end.
reallocAlign((void **)&c->tempBlurred[i], 8, stride*mbHeight*16 + 17*1024);
reallocAlign((void **)&c->tempBlurredPast[i], 8, 256*((height+7)&(~7))/2 + 17*1024);//FIXME size
}
diff --git a/libpostproc/postprocess_internal.h b/libpostproc/postprocess_internal.h
index fd0c7c1374..2256d78f78 100644
--- a/libpostproc/postprocess_internal.h
+++ b/libpostproc/postprocess_internal.h
@@ -100,7 +100,7 @@ typedef struct PPMode{
int minAllowedY; ///< for brigtness correction
int maxAllowedY; ///< for brihtness correction
- float maxClippedThreshold; ///< amount of "black" u r willing to loose to get a brightness corrected picture
+ float maxClippedThreshold; ///< amount of "black" you are willing to lose to get a brightness-corrected picture
int maxTmpNoise[3]; ///< for Temporal Noise Reducing filter (Maximal sum of abs differences)
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index adb3005753..5b84f89ec5 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -310,8 +310,8 @@ void shuffle_bytes_##a##b##c##d(const uint8_t *src, uint8_t *dst, int src_size)
} \
}
-DEFINE_SHUFFLE_BYTES(0, 3, 2, 1);
-DEFINE_SHUFFLE_BYTES(1, 2, 3, 0);
-DEFINE_SHUFFLE_BYTES(3, 0, 1, 2);
-DEFINE_SHUFFLE_BYTES(3, 2, 1, 0);
+DEFINE_SHUFFLE_BYTES(0, 3, 2, 1)
+DEFINE_SHUFFLE_BYTES(1, 2, 3, 0)
+DEFINE_SHUFFLE_BYTES(3, 0, 1, 2)
+DEFINE_SHUFFLE_BYTES(3, 2, 1, 0)
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 6a55e4fe69..ca444b2669 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -396,12 +396,12 @@ static void yuv2planeX_ ## bits ## BE_LE ## _c(const int16_t *filter, int filter
filterSize, (const typeX_t **) src, \
(uint16_t *) dest, dstW, is_be, bits); \
}
-yuv2NBPS( 9, BE, 1, 10, int16_t);
-yuv2NBPS( 9, LE, 0, 10, int16_t);
-yuv2NBPS(10, BE, 1, 10, int16_t);
-yuv2NBPS(10, LE, 0, 10, int16_t);
-yuv2NBPS(16, BE, 1, 16, int32_t);
-yuv2NBPS(16, LE, 0, 16, int32_t);
+yuv2NBPS( 9, BE, 1, 10, int16_t)
+yuv2NBPS( 9, LE, 0, 10, int16_t)
+yuv2NBPS(10, BE, 1, 10, int16_t)
+yuv2NBPS(10, LE, 0, 10, int16_t)
+yuv2NBPS(16, BE, 1, 16, int32_t)
+yuv2NBPS(16, LE, 0, 16, int32_t)
static void yuv2planeX_8_c(const int16_t *filter, int filterSize,
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, \
dstW, uvalpha, y, fmt); \
}
-YUV2PACKED16WRAPPER(yuv2gray16,, LE, PIX_FMT_GRAY16LE);
-YUV2PACKED16WRAPPER(yuv2gray16,, BE, PIX_FMT_GRAY16BE);
+YUV2PACKED16WRAPPER(yuv2gray16,, LE, PIX_FMT_GRAY16LE)
+YUV2PACKED16WRAPPER(yuv2gray16,, BE, PIX_FMT_GRAY16BE)
#define output_pixel(pos, acc) \
if (target == PIX_FMT_MONOBLACK) { \
@@ -715,8 +715,8 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \
y, fmt); \
}
-YUV2PACKEDWRAPPER(yuv2mono,, white, PIX_FMT_MONOWHITE);
-YUV2PACKEDWRAPPER(yuv2mono,, black, PIX_FMT_MONOBLACK);
+YUV2PACKEDWRAPPER(yuv2mono,, white, PIX_FMT_MONOWHITE)
+YUV2PACKEDWRAPPER(yuv2mono,, black, PIX_FMT_MONOBLACK)
#define output_pixels(pos, Y1, U, Y2, V) \
if (target == PIX_FMT_YUYV422) { \
@@ -827,8 +827,8 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
#undef output_pixels
-YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, PIX_FMT_YUYV422);
-YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, PIX_FMT_UYVY422);
+YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, PIX_FMT_YUYV422)
+YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, PIX_FMT_UYVY422)
#define R_B ((target == PIX_FMT_RGB48LE || target == PIX_FMT_RGB48BE) ? R : B)
#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,
#undef r_b
#undef b_r
-YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE);
-YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE);
-YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE);
-YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE);
+YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE)
+YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE)
+YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE)
+YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE)
static av_always_inline void
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, \
}
#if CONFIG_SMALL
-YUV2RGBWRAPPER(yuv2rgb,, 32_1, PIX_FMT_RGB32_1, CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
-YUV2RGBWRAPPER(yuv2rgb,, 32, PIX_FMT_RGB32, CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
+YUV2RGBWRAPPER(yuv2rgb,, 32_1, PIX_FMT_RGB32_1, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
+YUV2RGBWRAPPER(yuv2rgb,, 32, PIX_FMT_RGB32, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
#else
#if CONFIG_SWSCALE_ALPHA
-YUV2RGBWRAPPER(yuv2rgb,, a32_1, PIX_FMT_RGB32_1, 1);
-YUV2RGBWRAPPER(yuv2rgb,, a32, PIX_FMT_RGB32, 1);
+YUV2RGBWRAPPER(yuv2rgb,, a32_1, PIX_FMT_RGB32_1, 1)
+YUV2RGBWRAPPER(yuv2rgb,, a32, PIX_FMT_RGB32, 1)
#endif
-YUV2RGBWRAPPER(yuv2rgb,, x32_1, PIX_FMT_RGB32_1, 0);
-YUV2RGBWRAPPER(yuv2rgb,, x32, PIX_FMT_RGB32, 0);
+YUV2RGBWRAPPER(yuv2rgb,, x32_1, PIX_FMT_RGB32_1, 0)
+YUV2RGBWRAPPER(yuv2rgb,, x32, PIX_FMT_RGB32, 0)
#endif
-YUV2RGBWRAPPER(yuv2, rgb, rgb24, PIX_FMT_RGB24, 0);
-YUV2RGBWRAPPER(yuv2, rgb, bgr24, PIX_FMT_BGR24, 0);
-YUV2RGBWRAPPER(yuv2rgb,, 16, PIX_FMT_RGB565, 0);
-YUV2RGBWRAPPER(yuv2rgb,, 15, PIX_FMT_RGB555, 0);
-YUV2RGBWRAPPER(yuv2rgb,, 12, PIX_FMT_RGB444, 0);
-YUV2RGBWRAPPER(yuv2rgb,, 8, PIX_FMT_RGB8, 0);
-YUV2RGBWRAPPER(yuv2rgb,, 4, PIX_FMT_RGB4, 0);
-YUV2RGBWRAPPER(yuv2rgb,, 4b, PIX_FMT_RGB4_BYTE, 0);
+YUV2RGBWRAPPER(yuv2, rgb, rgb24, PIX_FMT_RGB24, 0)
+YUV2RGBWRAPPER(yuv2, rgb, bgr24, PIX_FMT_BGR24, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 16, PIX_FMT_RGB565, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 15, PIX_FMT_RGB555, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 12, PIX_FMT_RGB444, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 8, PIX_FMT_RGB8, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 4, PIX_FMT_RGB4, 0)
+YUV2RGBWRAPPER(yuv2rgb,, 4b, PIX_FMT_RGB4_BYTE, 0)
static av_always_inline void
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,
}
#if CONFIG_SMALL
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
-YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR, CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
-YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB, CONFIG_SWSCALE_ALPHA && c->alpPixBuf);
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
+YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
+YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB, CONFIG_SWSCALE_ALPHA && c->alpPixBuf)
#else
#if CONFIG_SWSCALE_ALPHA
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA, 1);
-YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR, 1);
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA, 1);
-YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB, 1);
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA, 1)
+YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR, 1)
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA, 1)
+YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB, 1)
#endif
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, PIX_FMT_BGRA, 0);
-YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, PIX_FMT_ABGR, 0);
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, PIX_FMT_RGBA, 0);
-YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, PIX_FMT_ARGB, 0);
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, PIX_FMT_BGRA, 0)
+YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, PIX_FMT_ABGR, 0)
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, PIX_FMT_RGBA, 0)
+YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, PIX_FMT_ARGB, 0)
#endif
-YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full, PIX_FMT_BGR24, 0);
-YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full, PIX_FMT_RGB24, 0);
+YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full, PIX_FMT_BGR24, 0)
+YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full, PIX_FMT_RGB24, 0)
static av_always_inline void fillPlane(uint8_t* plane, int stride,
int width, int height,
@@ -1537,10 +1537,10 @@ static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV
rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin); \
}
-rgb48funcs(rgb, LE, PIX_FMT_RGB48LE);
-rgb48funcs(rgb, BE, PIX_FMT_RGB48BE);
-rgb48funcs(bgr, LE, PIX_FMT_BGR48LE);
-rgb48funcs(bgr, BE, PIX_FMT_BGR48BE);
+rgb48funcs(rgb, LE, PIX_FMT_RGB48LE)
+rgb48funcs(rgb, BE, PIX_FMT_RGB48BE)
+rgb48funcs(bgr, LE, PIX_FMT_BGR48LE)
+rgb48funcs(bgr, BE, PIX_FMT_BGR48BE)
#define input_pixel(i) ((origin == PIX_FMT_RGBA || origin == PIX_FMT_BGRA || \
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, \
maskr, maskg, maskb, rsh, gsh, bsh, S); \
}
-rgb16_32_wrapper(PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT+8);
-rgb16_32_wrapper(PIX_FMT_BGR32_1, bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT+8);
-rgb16_32_wrapper(PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT+8);
-rgb16_32_wrapper(PIX_FMT_RGB32_1, rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT+8);
-rgb16_32_wrapper(PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT+8);
-rgb16_32_wrapper(PIX_FMT_BGR555LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT+7);
-rgb16_32_wrapper(PIX_FMT_RGB565LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT+8);
-rgb16_32_wrapper(PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT+7);
-rgb16_32_wrapper(PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT+8);
-rgb16_32_wrapper(PIX_FMT_BGR555BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT+7);
-rgb16_32_wrapper(PIX_FMT_RGB565BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT+8);
-rgb16_32_wrapper(PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT+7);
+rgb16_32_wrapper(PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT+8)
+rgb16_32_wrapper(PIX_FMT_BGR32_1, bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT+8)
+rgb16_32_wrapper(PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT+8)
+rgb16_32_wrapper(PIX_FMT_RGB32_1, rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT+8)
+rgb16_32_wrapper(PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT+8)
+rgb16_32_wrapper(PIX_FMT_BGR555LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT+7)
+rgb16_32_wrapper(PIX_FMT_RGB565LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT+8)
+rgb16_32_wrapper(PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT+7)
+rgb16_32_wrapper(PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT+8)
+rgb16_32_wrapper(PIX_FMT_BGR555BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT+7)
+rgb16_32_wrapper(PIX_FMT_RGB565BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT+8)
+rgb16_32_wrapper(PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT+7)
static void gbr24pToUV_half_c(uint16_t *dstU, uint16_t *dstV,
const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc,
diff --git a/libswscale/x86/swscale_mmx.c b/libswscale/x86/swscale_mmx.c
index 55dc08af55..e46da770ae 100644
--- a/libswscale/x86/swscale_mmx.c
+++ b/libswscale/x86/swscale_mmx.c
@@ -242,7 +242,7 @@ extern void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt(
SwsContext *c, int16_t *data, \
int dstW, const uint8_t *src, \
const int16_t *filter, \
- const int16_t *filterPos, int filterSize);
+ const int16_t *filterPos, int filterSize)
#define SCALE_FUNCS(filter_n, opt) \
SCALE_FUNC(filter_n, 8, 15, opt); \
diff --git a/tools/patcheck b/tools/patcheck
index 7e950dcc2e..cd6beee9bf 100755
--- a/tools/patcheck
+++ b/tools/patcheck
@@ -67,7 +67,7 @@ $EGREP $OPT '^\+ *(const *|)static' $*| $EGREP --color=always '[^=]= *(0|NULL)[^
cat $TMP
hiegrep '# *ifdef * (HAVE|CONFIG)_' 'ifdefs that should be #if' $*
-hiegrep '\b(awnser|cant|dont|quantised|quantisation|teh|wont)\b' 'common typos' $*
+hiegrep '\b(awnser|cant|dont|wont|usefull|successfull|occured|teh|alot|wether|skiped|heigth|informations|colums|loosy|loosing|seperate|preceed)\b' 'common typos' $*
hiegrep 'av_log\( *NULL' 'Missing context in av_log' $*
hiegrep '[^sn]printf' 'Please use av_log' $*