* 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>tags/n0.10
| @@ -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 */ | |||
| @@ -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); | |||
| @@ -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 | |||
| @@ -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. | |||
| @@ -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 | |||
| @@ -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 | |||
| @@ -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 */ | |||
| @@ -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; | |||
| @@ -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]); | |||
| @@ -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, | |||
| @@ -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; | |||
| @@ -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); | |||
| @@ -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); | |||
| @@ -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) { | |||
| @@ -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. */ | |||
| @@ -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= | |||
| @@ -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); | |||
| @@ -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) | |||
| @@ -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. | |||
| @@ -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: | |||
| @@ -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++) { | |||
| @@ -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 */ | |||
| @@ -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++) { | |||
| @@ -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) | |||
| @@ -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) | |||
| @@ -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 | |||
| @@ -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) | |||
| @@ -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; | |||
| @@ -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; | |||
| } | |||
| @@ -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 */ | |||
| @@ -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 | |||
| @@ -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) { | |||
| @@ -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 | |||
| @@ -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) { | |||
| @@ -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; | |||
| @@ -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); | |||
| @@ -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; | |||
| @@ -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); | |||
| @@ -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); | |||
| @@ -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); | |||
| @@ -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: | |||
| @@ -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); | |||
| @@ -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 */ | |||
| @@ -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); | |||
| @@ -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) | |||
| @@ -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; | |||
| } | |||
| } | |||
| @@ -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 | |||
| @@ -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; | |||
| @@ -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, | |||
| @@ -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. | |||
| /*@}*/ | |||
| @@ -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 */ | |||
| @@ -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; | |||
| } | |||
| @@ -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 */ | |||
| @@ -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); | |||
| @@ -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. */ | |||
| @@ -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; | |||
| } | |||
| @@ -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 | |||
| @@ -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); | |||
| @@ -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) | |||
| @@ -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); | |||
| @@ -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); | |||
| @@ -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 | |||
| @@ -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; | |||
| } | |||
| } | |||
| @@ -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; | |||
| } | |||
| @@ -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); | |||
| } | |||
| @@ -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 { | |||
| @@ -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. */ | |||
| @@ -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; | |||
| @@ -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) | |||
| @@ -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)" | |||
| @@ -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 */ | |||
| @@ -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 */ | |||
| @@ -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 | |||
| } | |||
| @@ -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) | |||
| @@ -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) | |||
| @@ -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, | |||
| @@ -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); \ | |||
| @@ -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' $* | |||