Compare commits
5 Commits
release/2.
...
n2.3
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bef4d9bf87 | ||
![]() |
bc4f6ae88e | ||
![]() |
2678b25099 | ||
![]() |
e322496054 | ||
![]() |
7fa72ff19c |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1 +0,0 @@
|
||||
*.pnm -diff -text
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -39,7 +39,6 @@
|
||||
/doc/examples/avio_reading
|
||||
/doc/examples/decoding_encoding
|
||||
/doc/examples/demuxing_decoding
|
||||
/doc/examples/extract_mvs
|
||||
/doc/examples/filter_audio
|
||||
/doc/examples/filtering_audio
|
||||
/doc/examples/filtering_video
|
||||
@@ -62,7 +61,6 @@
|
||||
/tests/audiogen
|
||||
/tests/base64
|
||||
/tests/data/
|
||||
/tests/pixfmts.mak
|
||||
/tests/rotozoom
|
||||
/tests/tiny_psnr
|
||||
/tests/tiny_ssim
|
||||
|
676
Changelog
676
Changelog
@@ -1,679 +1,6 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 2.4.13:
|
||||
- mov: Add an option to toggle dref opening
|
||||
- MAINTAINERS: remove unmaintained releases
|
||||
- avcodec/jpeg2000dec: More completely check cdef
|
||||
- avutil/opt: check for and handle errors in av_opt_set_dict2()
|
||||
- avcodec/flacenc: fix calculation of bits required in case of custom sample rate
|
||||
- avformat: Document urls a bit
|
||||
- avformat/concat: Check protocol prefix
|
||||
- doc/demuxers: Document enable_drefs and use_absolute_path
|
||||
- avcodec/mjpegdec: Check for end for both bytes in unescaping
|
||||
- avformat/avformat: Replace some references to filenames by urls
|
||||
- avcodec/wmaenc: Check ff_wma_init() for failure
|
||||
- avcodec/mpeg12enc: Move high resolution thread check to before initializing threads
|
||||
- avformat/avio: Limit url option parsing to the documented cases
|
||||
- avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()
|
||||
- avcodec/gif: Fix lzw buffer size
|
||||
- avcodec/put_bits: Assert buf_ptr in flush_put_bits()
|
||||
- avcodec/tiff: Check subsample & rps values more completely
|
||||
- swscale/swscale: Add some sanity checks for srcSlice* parameters
|
||||
- swscale/x86/rgb2rgb_template: Fix planar2x() for short width
|
||||
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_yv12_wrapper()
|
||||
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_rgb24_wrapper()
|
||||
- avcodec/wavpackenc: print channel count in av_log call
|
||||
- configure: bump copyright year to 2016
|
||||
- avformat/hls: Even stricter URL checks
|
||||
- avformat/hls: More strict url checks
|
||||
- swscale/yuv2rgb: Increase YUV2RGB table headroom
|
||||
- swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
|
||||
- avformat/hls: forbid all protocols except http(s) & file
|
||||
- avformat/aviobuf: Fix end check in put_str16()
|
||||
- avformat/asfenc: Check pts
|
||||
- avcodec/mpeg4video: Check time_incr
|
||||
- avcodec/wavpackenc: Check the number of channels
|
||||
- avcodec/wavpackenc: Headers are per channel
|
||||
- avcodec/dvdec: Fix "left shift of negative value -254"
|
||||
- avcodec/mjpegdec: Fix negative shift
|
||||
- avcodec/mss2: Check for repeat overflow
|
||||
- avformat: Add integer fps from 31 to 60 to get_std_framerate()
|
||||
- avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range
|
||||
- avcodec/motion_est: Fix mv_penalty table size
|
||||
- avcodec/h264_slice: Fix integer overflow in implicit weight computation
|
||||
- swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
|
||||
- avcodec/put_bits: Always check buffer end before writing
|
||||
- swscale/utils: Fix intermediate format for cascaded alpha downscaling
|
||||
- avcodec/h264_refs: Fix long_idx check
|
||||
- avfilter/vf_mpdecimate: Add missing emms_c()
|
||||
- avformat/mxfenc: Do not crash if there is no packet in the first stream
|
||||
- swscale/swscale-test: Fix slice height in random reference data creation.
|
||||
- dca: fix misaligned access in avpriv_dca_convert_bitstream
|
||||
- brstm: fix missing closing brace
|
||||
- brstm: also allocate b->table in read_packet
|
||||
- brstm: make sure an ADPC chunk was read for adpcm_thp
|
||||
- vorbisdec: reject rangebits 0 with non-0 partitions
|
||||
- vorbisdec: reject channel mapping with less than two channels
|
||||
- ffmdec: reset packet_end in case of failure
|
||||
- mjpegdec: extend check for incompatible values of s->rgb and s->ls
|
||||
- avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
|
||||
- avcodec/samidec: make sure to properly restore parsing context after a tag
|
||||
- x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
|
||||
- avcodec/mpeg4videodec: also for empty partitioned slices
|
||||
- nuv: sanitize negative fps rate
|
||||
- rawdec: only exempt BIT0 with need_copy from buffer sanity check
|
||||
- mlvdec: check that index_entries exist
|
||||
- nutdec: reject negative value_len in read_sm_data
|
||||
- xwddec: prevent overflow of lsize * avctx->height
|
||||
- nutdec: only copy the header if it exists
|
||||
- exr: fix out of bounds read in get_code
|
||||
- on2avc: limit number of bits to 30 in get_egolomb
|
||||
- sonic: make sure num_taps * channels is not larger than frame_size
|
||||
- opus_silk: fix typo causing overflow in silk_stabilize_lsf
|
||||
- ffm: reject invalid codec_id and codec_type
|
||||
- aaccoder: prevent crash of anmr coder
|
||||
- swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
|
||||
- swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
|
||||
|
||||
version 2.4.12:
|
||||
- avcodec/ffv1dec: Clear quant_table_count if its invalid
|
||||
- avcodec/ffv1dec: Print an error if the quant table count is invalid
|
||||
- avcodec/hevc: Check max ctb addresses for WPP
|
||||
- avcodec/vp3: ensure header is parsed successfully before tables
|
||||
- avcodec/jpeg2000dec: Check bpno in decode_cblk()
|
||||
- avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented in type int
|
||||
- swscale/utils: Fix for runtime error: left shift of negative value -1
|
||||
- avcodec/hevc: Fix integer overflow of entry_point_offset
|
||||
- avcodec/dirac_parser: Check that there is a previous PU before accessing it
|
||||
- avcodec/dirac_parser: Add basic validity checks for next_pu_offset and prev_pu_offset
|
||||
- avcodec/dirac_parser: Fix potential overflows in pointer checks
|
||||
- avcodec/wmaprodec: Check bits per sample to be within the range not causing integer overflows
|
||||
- avcodec/wmaprodec: Fix overflow of cutoff
|
||||
- avformat/smacker: fix integer overflow with pts_inc
|
||||
- avcodec/vp3: Fix "runtime error: left shift of negative value"
|
||||
- mpegencts: Fix overflow in cbr mode period calculations
|
||||
- avutil/timecode: Fix fps check
|
||||
- avutil/mathematics: return INT64_MIN (=AV_NOPTS_VALUE) from av_rescale_rnd() for overflows
|
||||
- avcodec/apedec: Check length in long_filter_high_3800()
|
||||
- avcodec/vp3: always set pix_fmt in theora_decode_header()
|
||||
- avcodec/mpeg4videodec: Check available data before reading custom matrix
|
||||
- avutil/mathematics: Do not treat INT64_MIN as positive in av_rescale_rnd
|
||||
- avutil/integer: Fix av_mod_i() with negative dividend
|
||||
- avformat/dump: Fix integer overflow in av_dump_format()
|
||||
- avcodec/utils: Clear dimensions in ff_get_buffer() on failure
|
||||
- avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()
|
||||
- avcodec/vp3: Clear context on reinitialization failure
|
||||
- avcodec/hevc: allocate entries unconditionally
|
||||
- avcodec/hevc_cabac: Fix multiple integer overflows
|
||||
- avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()
|
||||
- avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_decode*()
|
||||
- avcodec/hevc: Check entry_point_offsets
|
||||
- avcodec/cabac: Check initial cabac decoder state
|
||||
- avcodec/cabac_functions: Fix "left shift of negative value -31767"
|
||||
- avcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
|
||||
- avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
|
||||
- rtmpcrypt: Do the xtea decryption in little endian mode
|
||||
- avformat/matroskadec: Check subtitle stream before dereferencing
|
||||
- avformat/utils: Do not init parser if probing is unfinished
|
||||
- avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
|
||||
- avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range
|
||||
- avcodec/jpeg2000: Check comp coords to be within the supported size
|
||||
- avcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()
|
||||
- avcodec/wmaprodec: Check for overread in decode_packet()
|
||||
- avcodec/smacker: Check that the data size is a multiple of a sample vector
|
||||
- avcodec/takdec: Skip last p2 sample (which is unused)
|
||||
- avcodec/dxtory: Fix input size check in dxtory_decode_v1_410()
|
||||
- avcodec/dxtory: Fix input size check in dxtory_decode_v1_420()
|
||||
- avcodec/error_resilience: avoid accessing previous or next frames tables beyond height
|
||||
- avcodec/dpx: Move need_align to act per line
|
||||
- avcodec/flashsv: Check size before updating it
|
||||
- avcodec/ivi: Check image dimensions
|
||||
- avcodec/utils: Better check for channels in av_get_audio_frame_duration()
|
||||
- avcodec/jpeg2000dec: Check for duplicate SIZ marker
|
||||
- avcodec/jpeg2000dec: Clip all tile coordinates
|
||||
- avcodec/microdvddec: Check for string end in 'P' case
|
||||
- avcodec/dirac_parser: Fix undefined memcpy() use
|
||||
- avformat/xmv: Discard remainder of packet on error
|
||||
- avformat/xmv: factor return check out of if/else
|
||||
- libavutil/channel_layout: Check strtol*() for failure
|
||||
- avcodec/ffv1dec: Check for 0 quant tables
|
||||
- avcodec/mjpegdec: Reinitialize IDCT on BPP changes
|
||||
- avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
|
||||
- avutil/file_open: avoid file handle inheritance on Windows
|
||||
- avcodec/ffv1: Initialize vlc_state on allocation
|
||||
- avcodec/ffv1dec: update progress in case of broken pointer chains
|
||||
- avcodec/ffv1dec: Clear slice coordinates if they are invalid or slice header decoding fails for other reasons
|
||||
- avformat/httpauth: Add space after commas in HTTP/RTSP auth header
|
||||
- avcodec/x86/sbrdsp: Fix using uninitialized upper 32bit of noise
|
||||
- avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
|
||||
- avcodec/ffv1dec: Explicitly check read_quant_table() return value
|
||||
- avcodec/rangecoder: Check e
|
||||
- lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
|
||||
- avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
|
||||
- avfilter/af_asyncts: use llabs for int64_t
|
||||
- avcodec/g2meet: Also clear tile dimensions on header_fail
|
||||
- avcodec/g2meet: Fix potential overflow in tile dimensions check
|
||||
- avcodec/svq1dec: Check init_get_bits8() for failure
|
||||
- avcodec/tta: Check init_get_bits8() for failure
|
||||
- swresample/swresample: Fix integer overflow in seed calculation
|
||||
- avformat/mov: Fix integer overflow in FFABS
|
||||
- avutil/common: Add FFNABS()
|
||||
- avutil/common: Document FFABS() corner case
|
||||
- avformat/dump: Fix integer overflow in aspect ratio calculation
|
||||
- avcodec/truemotion1: Check for even width
|
||||
- avcodec/libopusenc: Fix infinite loop on flushing after 0 input
|
||||
- doc/filters/drawtext: fix centering example
|
||||
- avcodec: avoid division by zero in avcodec_string
|
||||
- mpegvideo: clear overread in clear_context
|
||||
- dvdsubdec: validate offset2 similar to offset1
|
||||
- avcodec/takdec: Use memove, avoid undefined memcpy() use
|
||||
- jvdec: avoid unsigned overflow in comparison
|
||||
- avcodec/mpeg12dec: Do not call show_bits() with invalid bits
|
||||
- opusdec: Don't run vector_fmul_scalar on zero length arrays
|
||||
- avcodec/opusdec: Fix extra samples read index
|
||||
- riffdec: prevent negative bit rate
|
||||
- Merge commit 'd80811c94e068085aab797f9ba35790529126f85'
|
||||
- imc: use correct position for flcoeffs2 calculation
|
||||
- snow: remove an obsolete av_assert2
|
||||
- wavpack: limit extra_bits to 32 and use get_bits_long
|
||||
- huffyuvdec: validate image size
|
||||
- wavpack: use get_bits_long to read up to 32 bits
|
||||
- nutdec: check maxpos in read_sm_data before returning success
|
||||
- s302m: fix arithmetic exception
|
||||
- mpegaudiodec: copy AVFloatDSPContext from first context to all contexts
|
||||
- vc1dec: use get_bits_long and limit the read bits to 32
|
||||
- avcodec/s302m: Only set the sample rate when some data is output
|
||||
- avidec: check for valid bit_rate range
|
||||
- vp9: add support for resolution changes in inter frames.
|
||||
- vp9: avoid infinite loop with broken files
|
||||
- videodsp: don't overread edges in vfix3 emu_edge.
|
||||
- avformat/oggenc: Check segments_count for headers too
|
||||
- avformat/avidec: Workaround broken initial frame
|
||||
- hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
|
||||
- hevc: fix wpp threading deadlock.
|
||||
- avcodec/ffv1: seperate slice_count from max_slice_count
|
||||
- lavf/img2dec: Fix memory leak
|
||||
- avcodec/mp3: fix skipping zeros
|
||||
- doc: mention libavcodec can decode Opus natively
|
||||
|
||||
|
||||
version 2.4.11:
|
||||
- avformat/hevc: Check num_long_term_ref_pics_sps to avoid potentially long loops
|
||||
- avformat/hevc: Fix parsing errors
|
||||
- ffmpeg: Use correct codec_id for av_parser_change() check
|
||||
- ffmpeg: Check av_parser_change() for failure
|
||||
- avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
|
||||
- ffmpeg: Check for RAWVIDEO and do not relay only on AVFMT_RAWPICTURE
|
||||
- ffmpeg: check avpicture_fill() return value
|
||||
- avformat/mux: Update sidedata in ff_write_chained()
|
||||
- avcodec/flashsvenc: Correct max dimension in error message
|
||||
- avcodec/svq1enc: Check dimensions
|
||||
- avcodec/dcaenc: clear bitstream end
|
||||
- libavcodec/aacdec_template: Use init_get_bits8() in aac_decode_frame()
|
||||
- rawdec: fix mjpeg probing buffer size check
|
||||
- rawdec: fix mjpeg probing
|
||||
- avcodec/vp8: Check buffer size in vp8_decode_frame_header()
|
||||
- avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()
|
||||
- avcodec/diracdec: Check for hpel_base allocation failure
|
||||
- avcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy()
|
||||
- avfilter/af_aresample: Check ff_all_* for allocation failures
|
||||
- avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case
|
||||
- swscale/utils: Clear pix buffers
|
||||
- avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()
|
||||
- avformat/mov: Fix deallocation when MOVStreamContext failed to allocate
|
||||
- ffmpeg: Fix cleanup with ost = NULL
|
||||
- avcodec/pthread_frame: check avctx on deallocation
|
||||
- avcodec/sanm: Reset sizes in destroy_buffers()
|
||||
- avcodec/alac: Clear pointers in allocate_buffers()
|
||||
- bytestream2: set the reader to the end when reading more than available
|
||||
- avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
|
||||
- avcodec/mpegvideo: Clear pointers in ff_mpv_common_init()
|
||||
- oggparsedirac: check return value of init_get_bits
|
||||
- wmalosslessdec: reset frame->nb_samples on packet loss
|
||||
- wmalosslessdec: avoid reading 0 bits with get_bits
|
||||
- avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2()
|
||||
- avcodec/aacsbr: Assert that bs_num_env is positive
|
||||
- avcodec/aacsbr: check that the element type matches before applying SBR
|
||||
- avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h
|
||||
- vp9/update_prob: prevent out of bounds table read
|
||||
- avfilter/vf_transpose: Fix rounding error
|
||||
- avcodec/pngdec: Only allow one IHDR chunk
|
||||
- wmavoice: limit wmavoice_decode_packet return value to packet size
|
||||
- swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian
|
||||
- ffmpeg: Do not use the data/size of a bitstream filter after failure
|
||||
- swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext}
|
||||
- swscale/x86/rgb2rgb_template: add missing xmm clobbers
|
||||
- vda: unlock the pixel buffer base address.
|
||||
- swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()
|
||||
- swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE
|
||||
- swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian
|
||||
- swr: Remember previously set int_sample_format from user
|
||||
- matroskadec: check audio sample rate
|
||||
- matroskadec: validate audio channels and bitdepth
|
||||
- avcodec/dpxenc: implement write16/32 as functions
|
||||
- postproc: fix unaligned access
|
||||
- avio: fix potential crashes when combining ffio_ensure_seekback + crc
|
||||
- h264: er: Copy from the previous reference only if compatible
|
||||
- sonic: set avctx->channels in sonic_decode_init
|
||||
- vp8: change mv_{min,max}.{x,y} type to int
|
||||
- vp9: change type of tile_size from unsigned to int64_t
|
||||
- arm: only enable setend on ARMv6
|
||||
- libopenjpegdec: check existence of image component data
|
||||
- mov: abort on EOF in ff_mov_read_chan
|
||||
- ffmpeg_opt: Check for localtime() failure
|
||||
- avformat: Fix bug in parse_rps for HEVC.
|
||||
- takdec: ensure chan2 is a valid channel index
|
||||
- avcodec/h264_slice: Use AVFrame diemensions for grayscale handling
|
||||
- avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet()
|
||||
- libavutil/channel_layout: Correctly return layout when channel specification ends with a trailing 'c'.
|
||||
- avcodec/jpeg2000dec: Check that coords match before applying ICT
|
||||
- avformat/ffmdec: Check ffio_set_buf_size() return value
|
||||
- avcodec/adpcm: Check for overreads
|
||||
- avcodec/alsdec: Check for overread
|
||||
- avcodec/atrac3plusdec: consume only as many bytes as available
|
||||
- swresample/swresample: Cleanup on init failure.
|
||||
- Revert "avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr dereference"
|
||||
- avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec
|
||||
- swresample/dither: check memory allocation
|
||||
- opusdec: properly handle mismatching configurations in multichannel streams
|
||||
- MAINTAINERS: Remove myself as leader
|
||||
- h263: Always check both dimensions
|
||||
- avformat/swfdec: Do not error out on pixel format changes
|
||||
- avcodec/exr: fix crash caused by merge
|
||||
- avcodec/x86/h264_weight: handle weight1=128
|
||||
- avcodec/hevc_ps: Only discard overread VPS if a previous is available
|
||||
- avformat/mov: Mark avio context of decompressed atoms as seekable
|
||||
_ avfilter/x86/vf_hqdn3d: Fix register types
|
||||
|
||||
version 2.4.10:
|
||||
- diracdec: check if reference could not be allocated
|
||||
- diracdec: avoid overflow of bytes*8 in decode_lowdelay
|
||||
- diracdec: prevent overflow in data_unit_size check
|
||||
- avformat/matroskadec: Use tracks[k]->stream instead of s->streams[k]
|
||||
- matroskadec: check s->streams[k] before using it
|
||||
- avcodec/ffv1dec: Check chroma shift parameters
|
||||
- matroskadec: use uint64_t instead of int for index_scale
|
||||
- avcodec/wavpack: Check L/R values before use to avoid harmless integer overflow and undefined behavior in fate
|
||||
- nutdec: fix illegal count check in decode_main_header
|
||||
- nutdec: check for negative frame rate in decode_info_header
|
||||
- ffmpeg: remove incorrect network deinit
|
||||
- OpenCL: Avoid potential buffer overflow in cmdutils_opencl.c
|
||||
- apedec: set s->samples only when init_frame_decoder succeeded
|
||||
- OS/2:Makedef.cmd cleanup
|
||||
- avcodec/golomb: get_ur_golomb_jpegls: Fix reading huge k values
|
||||
- avformat/mov: Fix parsing short loci
|
||||
- avformat/mov: Print reason of loci parsing failure
|
||||
- avcodec/hevc: Fix typo in num_entry_point_offsets check
|
||||
- avcodec/libtheoraenc: Check for av_malloc failure
|
||||
- avcodec/dcadec: Check active_bands
|
||||
- avcodec/dcadec: Check scale table index
|
||||
- avcodec/sonic: More completely check sample_rate_index and channels
|
||||
- avcodec/sonic: check memory allocations
|
||||
- avcodec/smvjpegdec: check avcodec_decode_video2() return code
|
||||
- avcodec/shorten: More complete pred_order check
|
||||
- avcodec/shorten: Check skip_bytes()
|
||||
- png: Set the color range as full range
|
||||
- mpegts: Update the PSI/SI table only if the version change
|
||||
- rtsp: Make sure we don't write too many transport entries into a fixed-size array
|
||||
- rtpenc_jpeg: Handle case of picture dimensions not dividing by 8
|
||||
- libvpx: Fix mixed use of av_malloc() and av_reallocp()
|
||||
- aacpsy: correct calculation of minath in psy_3gpp_init
|
||||
- avcodec/shorten: Fix code depending on signed overflow behavior
|
||||
- avcodec/proresdec2: Reset slice_count on deallocation
|
||||
- ffmpeg_opt: Fix -timestamp parsing
|
||||
- avcodec/dcadec: Check subsubframes
|
||||
- avcodec/dcadec: Check nchans
|
||||
- hevc: make avcodec_decode_video2() fail if get_format() fails
|
||||
- avcodec/cavsdec: Check esc_code
|
||||
- avcodec/on2avc: Check run more carefully
|
||||
- avcodec/mpeg4audio: add some padding/alignment to MAX_PCE_SIZE
|
||||
- swr: fix alignment issue caused by 8ch sse functions
|
||||
- avcodec/mjpegdec: fix len computation in ff_mjpeg_decode_dqt()
|
||||
- avcodec/jpeg2000dec: fix boolean operator
|
||||
- avcodec/hevc_ps: Explicitly check num_tile_* for negative values
|
||||
- avcodec/hevc_ps: Check vps_num_hrd_parameters
|
||||
- avcodec/hevc_ps: More completely check vps_num_layer_sets
|
||||
- avcodec/hevc: Check num_entry_point_offsets
|
||||
- avcodec/hevc: Check offset_len
|
||||
- libswscale/x86/hscale_fast_bilinear_simd.c: Include BX in the clobber list on x86_64, because it isn't implicitly included when PIC is on.
|
||||
- avcodec/hevc_sei: Check num_sps_ids_minus1 value
|
||||
- avcodec/vqavideo: Check chunk size
|
||||
- aacdec: don't return frames without data
|
||||
- avformat/hevc: Check num_negative_pics and num_positive_pics
|
||||
- avformat/hevc: Check cpb_cnt_minus1
|
||||
- avformat/matroskadec: Cleanup error handling for bz2 & zlib
|
||||
- avformat/nutdec: Fix use of uinitialized value
|
||||
- avformat/rtpenc_jpeg: Check remaining buffer size for SOS
|
||||
- avformat/rtpdec_xiph: Check upper bound on len in xiph_handle_packet()
|
||||
- tools/graph2dot: use larger data types than int for array/string sizes
|
||||
- avformat/matroskaenc: Check ff_vorbiscomment_length in put_flac_codecpriv()
|
||||
- avformat/oggenc: Check ff_vorbiscomment_length in ogg_write_vorbiscomment()
|
||||
- avformat/flacenc: Check length in flac_write_block_comment()
|
||||
- avformat/subtitles: Use size_t for len
|
||||
- avformat/url: Use size_t for len from strlen()
|
||||
- avutil/avstring: Use size_t in av_strlcatf()
|
||||
- avformat/vorbiscomment: Check entry length in ff_vorbiscomment_write()
|
||||
- avutil/dict: Use size_t for appending strings
|
||||
- libavutil/mem: use size_t for the length in av_strdup()
|
||||
- aacsbr: break infinite loop in sbr_hf_calc_npatches
|
||||
- diracdec: check that block length is valid
|
||||
- ffmpeg_opt: Set the video VBV parameters only for the video stream from -target
|
||||
- avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()
|
||||
- avcodec/put_bits: Assert that there is enough space left in skip_put_bytes()
|
||||
- avcodec/mpegvideo_enc: Update the buffer size as more slices are merged
|
||||
- avcodec/put_bits: Update size_in_bits in set_put_bits_buffer_size()
|
||||
- avformat/wavdec: Increase dts packet threshold to fix more misdetections
|
||||
- avformat/wavdec: Increase probe_packets limit
|
||||
- nutdec: abort if EOF is reached in decode_info_header/read_sm_data
|
||||
- nutdec: stop skipping bytes at EOF
|
||||
- nutdec: fix infinite resync loops
|
||||
- avformat/nutdec: Check X in 2nd branch of index reading
|
||||
- avformat/nutdec: Fix recovery when immedeately after seeking a failure happens
|
||||
- avformat/nutdec: Return error on EOF from get_str()
|
||||
- avcodec/x86/cavsdsp: remove unneeded tmp
|
||||
- nutdec: fix memleaks on error in nut_read_header
|
||||
- avformat/avidec: print a warning for negative sample_size
|
||||
- avidec: avoid infinite loop due to negative ast->sample_size
|
||||
- nutdec: check chapter creation in decode_info_header
|
||||
- apedec: prevent out of array writes in decode_array_0000
|
||||
- avformat/mpegts: Detect changes in packet through CRC instead of just the 5bit version
|
||||
- avformat/mpegts: reset last_ver on corrupted packets
|
||||
- avformat/mpegts: Factorize version checking code out
|
||||
- avformat/mpegts: Also parse the FMC descriptor if the codec has not been identified yet
|
||||
- avformat/mpegts: reset last_version on seeking
|
||||
- avformat/mp3dec: Check for avcodec_alloc_context3() failure
|
||||
- avformat/mp3dec: properly allocate dummy AVCodecContext
|
||||
- lavfi/fade: Do not overread input buffer.
|
||||
- tests: drop bc dependency
|
||||
- alsdec: limit avctx->bits_per_raw_sample to 32
|
||||
|
||||
|
||||
version 2.4.9:
|
||||
- alac: reject rice_limit 0 if compression is used
|
||||
- lavf: Reset global flag on deinit
|
||||
- bink: check vst->index_entries before using it
|
||||
- mpeg4videodec: only allow a positive length
|
||||
- alsdec: check sample pointer range in revert_channel_correlation
|
||||
- avcodec/h264_refs: Do not set reference to things which do not exist
|
||||
- avcodec/h264: Fail for invalid mixed IDR / non IDR frames in slice threading mode
|
||||
- h264: avoid unnecessary calls to get_format
|
||||
- avutil/pca: Check for av_malloc* failures
|
||||
- alsdec: validate time diff index
|
||||
- avcodec/alsdec: Use av_mallocz_array() for chan_data to ensure the arrays never contain random data
|
||||
- alsdec: ensure channel reordering is reversible
|
||||
- avcodec/atrac3plusdsp: fix on stack alignment
|
||||
- ac3: validate end in ff_ac3_bit_alloc_calc_mask
|
||||
- aacpsy: avoid psy_band->threshold becoming NaN
|
||||
- aasc: return correct buffer size from aasc_decode_frame
|
||||
- aacdec: consistently use avctx for logging in decode_eld_specific_config
|
||||
- msrledec: use signed pixel_ptr in msrle_decode_pal4
|
||||
- swresample/swresample-test: Randomly wipe out channel counts
|
||||
- swresample: Check channel layouts and channels against each other and print human readable error messages
|
||||
- swresample: Allow reinitialization without ever setting channel layouts
|
||||
- swresample: Allow reinitialization without ever setting channel counts
|
||||
- avcodec/h264: Do not fail with randomly truncated VUIs
|
||||
- avcodec/h264_ps: Move truncation check from VUI to SPS
|
||||
- avcodec/h264: Be more tolerant to changing pps id between slices
|
||||
- avcodec/aacdec: Fix storing state before PCE decode
|
||||
- avcodec/h264: reset the counts in the correct context
|
||||
- avcodec/h264_slice: Do not reset mb_aff_frame per slice
|
||||
- tests: Fix test name for pixfmts tests
|
||||
- avcodec/h264: finish previous slices before switching to single thread mode
|
||||
- avcodec/h264: Fix race between slices where one overwrites data from the next
|
||||
- avformat/utils: avoid discarded streams in av_find_default_stream_index()
|
||||
- avformat/utils: Ensure that AVFMT_FLAG_CUSTOM_IO is set before use
|
||||
- avformat/img2dec: do not rewind custom io buffers
|
||||
- fate: Include branch information in the payload header
|
||||
|
||||
|
||||
version 2.4.8:
|
||||
- avutil/cpu: add missing check for mmxext to av_force_cpu_flags
|
||||
- avcodec/msrledec: restructure msrle_decode_pal4() based on the line number instead of the pixel pointer
|
||||
- avcodec/hevc_ps: Check cropping parameters more correctly
|
||||
- avcodec/dnxhddec: Check that the frame is interlaced before using cur_field
|
||||
- avformat/mov: Disallow ".." in dref unless use_absolute_path is set
|
||||
- avformat/mov: Check for string truncation in mov_open_dref()
|
||||
- ac3_fixed: fix out-of-bound read
|
||||
- avcodec/012v: redesign main loop
|
||||
- avcodec/012v: Check dimensions more completely
|
||||
- asfenc: fix leaking asf->index_ptr on error
|
||||
- avcodec/options_table: remove extradata_size from the AVOptions table
|
||||
- ffmdec: limit the backward seek to the last resync position
|
||||
- ffmdec: make sure the time base is valid
|
||||
- ffmdec: fix infinite loop at EOF
|
||||
- avcodec/tiff: move bpp check to after "end:"
|
||||
- avcodec/opusdec: Fix delayed sample value
|
||||
- avcodec/utils: Align YUV411 by as much as the other YUV variants
|
||||
- vp9: fix segmentation map retention with threading enabled.
|
||||
- doc/protocols/tcp: fix units of listen_timeout option value, from microseconds to milliseconds
|
||||
- fix VP9 packet decoder returning 0 instead of the used data size
|
||||
- avformat/bit: only accept the g729 codec and 1 channel
|
||||
- avformat/adxdec: check avctx->channels for invalid values
|
||||
- Fix buffer_size argument to init_put_bits() in multiple encoders.
|
||||
- mips/acelp_filters: fix incorrect register constraint
|
||||
- avcodec/hevc_ps: Sanity checks for some log2_* values
|
||||
- avcodec/zmbv: Check len before reading in decode_frame()
|
||||
- avcodec/snowdec: Fix ref value check
|
||||
- swscale/utils: More carefully merge and clear coefficients outside the input
|
||||
- avcodec/a64multienc: fix use of uninitialized values in to_meta_with_crop
|
||||
- avcodec/a64multienc: don't set incorrect packet size
|
||||
- webp: ensure that each transform is only used once
|
||||
- avcodec/hevc_ps: More complete window reset
|
||||
- vp9: make above buffer pointer 32-byte aligned.
|
||||
- avformat/rm: limit packet size
|
||||
- avcodec/webp: validate the distance prefix code
|
||||
- avcodec/gif: fix off by one in column offsetting finding
|
||||
|
||||
|
||||
version 2.4.7:
|
||||
- avcodec/flac_parser: fix handling EOF if no headers are found
|
||||
- avfilter/vf_framepack: Check and update frame_rate
|
||||
- avcodec/hevc: Fix handling of skipped_bytes() reallocation failures
|
||||
- qpeg: avoid pointless invalid memcpy()
|
||||
- avcodec/arm/videodsp_armv5te: Fix linking failure with "g++ -shared -D__STDC_CONSTANT_MACROS -o test.so ... libavcodec.a"
|
||||
- avcodec/mjpegdec: Skip blocks which are outside the visible area
|
||||
- lavc/aarch64: Do not use the neon horizontal chroma loop filter for H.264 4:2:2. (cherry picked from commit 4faea46bd906b3897018736208123aa36c3f45d5)
|
||||
- avcodec/h264_slice: assert that reinit does not occur after the first slice
|
||||
- avcodec/h264_slice: ignore SAR changes in slices after the first
|
||||
- avcodec/h264_slice: Check picture structure before setting the related fields
|
||||
- avcodec/h264_slice: Do not change frame_num after the first slice
|
||||
- avutil/opt: Fix type used to access AV_OPT_TYPE_SAMPLE_FMT
|
||||
- avutil/opt: Fix types used to access AV_OPT_TYPE_PIXEL_FMT
|
||||
- avcodec/h264: Be more strict on rejecting pps/sps changes
|
||||
- avcodec/h264: Be more strict on rejecting pps_id changes
|
||||
- avcodec/h264_ps: More completely check the bit depths
|
||||
- avformat/thp: Check av_get_packet() for failure not only for partial output
|
||||
- swscale/utils: Limit filter shifting so as not to read from prior the array
|
||||
- avcodec/mpegvideo_motion: Fix gmc chroma dimensions
|
||||
- avcodec/mjpegdec: Check number of components for JPEG-LS
|
||||
- avcodec/mjpegdec: Check escape sequence validity
|
||||
- avformat/mpc8: Use uint64_t in *_get_v() to avoid undefined behavior
|
||||
- avformat/mpc8: fix broken pointer math
|
||||
- avformat/mpc8: fix hang with fuzzed file
|
||||
- avformat/tta: fix crash with corrupted files
|
||||
|
||||
version 2.4.6:
|
||||
- doc/examples: fix lib math dep for decoding_encoding
|
||||
- avformat/movenc: workaround bug in "PathScale EKOPath(tm) Compiler Suite Version 4.0.12.1"
|
||||
- vp9: fix parser return values in error case
|
||||
- ffmpeg: Clear error message array at init.
|
||||
- avcodec/dvdsubdec: fix accessing dangling pointers
|
||||
- avcodec/dvdsubdec: error on bitmaps with size 0
|
||||
- avformat/mov: Fix mixed declaration and statement warning
|
||||
- cmdutils: Use 64bit for file size/offset related variable in cmdutils_read_file()
|
||||
- avformat/utils: Clear pointer in ff_alloc_extradata() to avoid leaving a stale pointer in memory
|
||||
- avformat/matroskadec: Use av_freep() to avoid leaving stale pointers in memory
|
||||
- lavfi: check av_strdup() return value
|
||||
- mov: Fix negative size calculation in mov_read_default().
|
||||
- avformat/mov: fix integer overflow in mov_read_udta_string()
|
||||
- mov: Avoid overflow with mov_metadata_raw()
|
||||
- avcodec/dvdsubdec: fix out of bounds accesses
|
||||
- avfilter/vf_sab: fix filtering tiny images
|
||||
- avformat/flvdec: Increase string array size
|
||||
- avformat/flvdec: do not inject dts=0 metadata packets which failed to be parsed into a new data stream
|
||||
- avformat/cdxl: Fix integer overflow of image_size
|
||||
- avformat/segment: Use av_freep() avoid leaving stale pointers in memory
|
||||
- avformat/mov: Fix memleaks for duplicate STCO/CO64/STSC atoms
|
||||
- mov: avoid a memleak when multiple stss boxes are presen
|
||||
|
||||
version 2.4.5:
|
||||
- lavu/frame: fix malloc error path in av_frame_copy_props()
|
||||
- avformat/utils: Do not update programs streams from program-less streams in update_wrap_reference()
|
||||
- avformat/aviobuf: Check that avio_seek() target is non negative
|
||||
- swresample/soxr_resample: fix error handling
|
||||
- avformat/flvdec: fix potential use of uninitialized variables
|
||||
- avformat/matroskadec: fix handling of recursive SeekHead elements
|
||||
- doc/examples/transcoding: check encoder before using it
|
||||
- swscale/x86/rgb2rgb_template: fix crash with tiny size and nv12 output
|
||||
- avformat/rmdec: Check codec_data_size
|
||||
- avformat/aviobuf: Fix infinite loop in ff_get_line()
|
||||
- vc1: Do not assume seek happens after decoding
|
||||
- mmvideo: check frame dimensions
|
||||
- jvdec: check frame dimensions
|
||||
- avcodec/indeo3: ensure offsets are non negative
|
||||
- avcodec/h264: Check *log2_weight_denom
|
||||
- avcodec/hevc_ps: Check diff_cu_qp_delta_depth
|
||||
- avcodec/h264: Clear delayed_pic on deallocation
|
||||
- avcodec/hevc: clear filter_slice_edges() on allocation
|
||||
- avcodec/dcadec: Check that the added xch channel isnt already there
|
||||
- avcodec/indeo3: use signed variables to avoid underflow
|
||||
- swscale: increase yuv2rgb table headroom
|
||||
- avformat/mov: fix integer overflow of size
|
||||
- avformat/mov: check atom nesting depth
|
||||
- avcodec/utvideodec: Fix handling of slice_height=0
|
||||
- avcodec/vmdvideo: Check len before using it in method 3
|
||||
- avformat/flvdec: Use av_freep() avoid leaving stale pointers in memory
|
||||
- avformat/hdsenc: Use av_freep() avoid leaving stale pointers in memory
|
||||
- configure: create the tests directory like the doc directory
|
||||
- v4l2: Make use of the VIDIOC_ENUM_FRAMESIZES ioctl on OpenBSD
|
||||
- avcodec/motion_est: use 2x8x8 for interlaced qpel
|
||||
- Treat all '*.pnm' files as non-text file
|
||||
|
||||
version 2.4.4:
|
||||
- avformat: replace some odd 30-60 rates by higher less odd ones in get_std_framerate()
|
||||
- swscale: fix yuv2yuvX_8 assembly on x86
|
||||
- avcodec/hevc_ps: Check num_long_term_ref_pics_sps
|
||||
- avcodec/mjpegdec: Fix integer overflow in shift
|
||||
- avcodec/hevc_ps: Check return code from pps_range_extensions()
|
||||
- avcodec/rawdec: Check the return code of avpicture_get_size()
|
||||
- avcodec/pngdec: Check IHDR/IDAT order
|
||||
- avcodec/flacdec: Call ff_flacdsp_init() unconditionally
|
||||
- avcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata()
|
||||
- avcodec/mjpegdec: Fix context fields becoming inconsistent
|
||||
- avcodec/mjpegdec: Check for pixfmtid 0x42111100 || 0x24111100 with more than 8 bits
|
||||
- swscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()
|
||||
- doc/APIchanges: Fix some wrong versions
|
||||
- avformat/hlsenc: Free context after hls_append_segment
|
||||
- avcodec/mpeg4video_parser: fix spurious extradata parse warnings
|
||||
- lavu/opt: fix av_opt_get function
|
||||
- avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization
|
||||
- avcodec/utvideodec: fix assumtation that slice_height >= 1
|
||||
- avcodec/options_table fix min of audio channels and sample rate
|
||||
- libavutil/thread.h: Support OS/2 threads
|
||||
- fix Makefile objects for pulseaudio support
|
||||
- opusdec: make sure all substreams have the same number of coded samples
|
||||
- lavu: add wrappers for the pthreads mutex API
|
||||
- avformat/avidec: fix handling dv in avi
|
||||
- avfilter/vf_lut: gammaval709()
|
||||
- cinedec: report white balance gain coefficients using metadata
|
||||
- swscale/utils: support bayer input + scaling, and bayer input + any supported output
|
||||
- swscale: support internal scaler cascades
|
||||
- avformat/dtsdec: dts_probe: check reserved bit, check lfe, check sr_code similarity
|
||||
- avformat/segment: export inner muxer timebase
|
||||
- Remove fminf() emulation, fix build issues
|
||||
- avcodec/mpegaudio_parser: fix off by 1 error in bitrate calculation
|
||||
- Use -fno-optimize-sibling-calls on parisc also for gcc 4.9.
|
||||
- ffmpeg_opt: store canvas size in decoder context
|
||||
- avcodec/mpeg12dec: do not trust AVCodecContext input dimensions
|
||||
|
||||
version 2.4.3:
|
||||
- avcodec/svq1dec: zero terminate embedded message before printing
|
||||
- avcodec/cook: check that the subpacket sizes fit in block_align
|
||||
- avcodec/g2meet: check tile dimensions to avoid integer overflow
|
||||
- avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
|
||||
- avcodec/dnxhddec: treat pix_fmt like width/height
|
||||
- avcodec/dxa: check dimensions
|
||||
- avcodec/dirac_arith: fix integer overflow
|
||||
- avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
|
||||
- avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
|
||||
- avcodec/sgidec: fix count check
|
||||
- avcodec/sgidec: fix linesize for 16bit
|
||||
- avcodec/hevc_ps: Check default display window bitstream and skip if invalid
|
||||
- avcodec/tiffenc: properly compute packet size
|
||||
- lavd: export all symbols with av_ prefix
|
||||
- avformat/mxfdec: Fix termination of mxf_data_essence_container_uls
|
||||
- postproc: fix qp count
|
||||
- postproc/postprocess: fix quant store for fq mode
|
||||
- vf_drawtext: add missing clear of pointers after av_expr_free()
|
||||
- utvideoenc: properly set slice height/last line
|
||||
- swresample: fix sample drop loop end condition
|
||||
- resample: Avoid off-by-1 errors in PTS calcs.
|
||||
- imc: fix order of operations in coefficients read
|
||||
- hevc_mvs: make sure to always initialize the temporal MV fully
|
||||
- hevc_mvs: initialize the temporal MV in case of missing reference
|
||||
|
||||
version 2.4.2:
|
||||
- avcodec/on2avc: Check number of channels
|
||||
- avcodec/hevc: fix chroma transform_add size
|
||||
- avcodec/h264: Check mode before considering mixed mode intra prediction
|
||||
- avformat/mpegts: use a padded buffer in read_sl_header()
|
||||
- avformat/mpegts: Check desc_len / get8() return code
|
||||
- avcodec/vorbisdec: Fix off by 1 error in ptns_to_read
|
||||
- sdp: add support for H.261
|
||||
- avcodec/svq3: Do not memcpy AVFrame
|
||||
- avcodec/smc: fix off by 1 error
|
||||
- avcodec/qpeg: fix off by 1 error in MV bounds check
|
||||
- avcodec/gifdec: factorize interleave end handling out
|
||||
- avcodec/cinepak: fix integer underflow
|
||||
- avcodec/pngdec: Check bits per pixel before setting monoblack pixel format
|
||||
- avcodec/pngdec: Calculate MPNG bytewidth more defensively
|
||||
- avcodec/tiff: more completely check bpp/bppcount
|
||||
- avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks
|
||||
- avcodec/h263dec: Fix decoding messenger.h263
|
||||
- avcodec/utils: Add case for jv to avcodec_align_dimensions2()
|
||||
- avcodec/mjpegdec: check bits per pixel for changes similar to dimensions
|
||||
- avcodec/jpeglsdec: Check run value more completely in ls_decode_line()
|
||||
- avformat/hlsenc: export inner muxer timebase
|
||||
- configure: add noexecstack to linker options if supported.
|
||||
- avcodec/ac3enc_template: fix out of array read
|
||||
- avutil/x86/cpu: fix cpuid sub-leaf selection
|
||||
- avformat/img2dec: enable generic seeking for image pipes
|
||||
- avformat/img2dec: initialize pkt->pos for image pipes
|
||||
- avformat/img2dec: pass error code and signal EOF
|
||||
- avformat/img2dec: fix error code at EOF for pipes
|
||||
- libavutil/opt: fix av_opt_set_channel_layout() to access correct memory address
|
||||
- tests/fate-run.sh: Cat .err file in case of error with V>0
|
||||
- avformat/riffenc: Filter out "BottomUp" in ff_put_bmp_header()
|
||||
- avcodec/webp: fix default palette color 0xff000000 -> 0x00000000
|
||||
- avcodec/asvenc: fix AAN scaling
|
||||
- Fix compile error on arm4/arm5 platform
|
||||
|
||||
|
||||
version 2.4.1:
|
||||
- swscale: Allow chroma samples to be above and to the left of luma samples
|
||||
- avcodec/libilbc: support for latest git of libilbc
|
||||
- avcodec/webp: treat out-of-bound palette index as translucent black
|
||||
- vf_deshake: rename Transform.vector to Transform.vec to avoid compiler confusion
|
||||
- apetag: Fix APE tag size check
|
||||
- tools/crypto_bench: fix build when AV_READ_TIME is unavailable
|
||||
|
||||
|
||||
version 2.4:
|
||||
- Icecast protocol
|
||||
- ported lenscorrection filter from frei0r filter
|
||||
- large optimizations in dctdnoiz to make it usable
|
||||
- ICY metadata are now requested by default with the HTTP protocol
|
||||
- support for using metadata in stream specifiers in fftools
|
||||
- LZMA compression support in TIFF decoder
|
||||
- support for H.261 RTP payload format (RFC 4587)
|
||||
- HEVC/H.265 RTP payload format (draft v6) depacketizer
|
||||
- added codecview filter to visualize information exported by some codecs
|
||||
- Matroska 3D support thorugh side data
|
||||
- HTML generation using texi2html is deprecated in favor of makeinfo/texi2any
|
||||
- silenceremove filter
|
||||
|
||||
|
||||
version 2.3:
|
||||
- AC3 fixed-point decoding
|
||||
- shuffleplanes filter
|
||||
@@ -697,7 +24,7 @@ version 2.3:
|
||||
- libbs2b-based stereo-to-binaural audio filter
|
||||
- libx264 reference frames count limiting depending on level
|
||||
- native Opus decoder
|
||||
- display matrix export and rotation API
|
||||
- display matrix export and rotation api
|
||||
- WebVTT encoder
|
||||
- showcqt multimedia filter
|
||||
- zoompan filter
|
||||
@@ -739,7 +66,6 @@ version 2.2:
|
||||
- libx265 encoder
|
||||
- dejudder filter
|
||||
- Autodetect VDA like all other hardware accelerations
|
||||
- aliases and defaults for Ogg subtypes (opus, spx)
|
||||
|
||||
|
||||
version 2.1:
|
||||
|
@@ -15,7 +15,6 @@ Specifically, the GPL parts of FFmpeg are:
|
||||
- libpostproc
|
||||
- libmpcodecs
|
||||
- optional x86 optimizations in the files
|
||||
libavcodec/x86/flac_dsp_gpl.asm
|
||||
libavcodec/x86/idct_mmx.c
|
||||
- libutvideo encoding/decoding wrappers in
|
||||
libavcodec/libutvideo*.cpp
|
||||
@@ -34,7 +33,6 @@ Specifically, the GPL parts of FFmpeg are:
|
||||
- vf_geq.c
|
||||
- vf_histeq.c
|
||||
- vf_hqdn3d.c
|
||||
- vf_interlace.c
|
||||
- vf_kerndeint.c
|
||||
- vf_mcdeint.c
|
||||
- vf_mp.c
|
||||
|
15
MAINTAINERS
15
MAINTAINERS
@@ -14,6 +14,7 @@ patches and related discussions.
|
||||
Project Leader
|
||||
==============
|
||||
|
||||
Michael Niedermayer
|
||||
final design decisions
|
||||
|
||||
|
||||
@@ -53,7 +54,7 @@ release management Michael Niedermayer
|
||||
Communication
|
||||
=============
|
||||
|
||||
website Deby Barbara Lepage
|
||||
website Robert Swain
|
||||
fate.ffmpeg.org Timothy Gu
|
||||
Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos, Lou Logan
|
||||
mailing lists Michael Niedermayer, Baptiste Coudurier, Lou Logan
|
||||
@@ -318,7 +319,7 @@ libavdevice
|
||||
pulse_audio_enc.c Lukasz Marek
|
||||
qtkit.m Thilo Borgmann
|
||||
sdl Stefano Sabatini
|
||||
v4l2.c Giorgio Vazzana
|
||||
v4l2.c Luca Abeni
|
||||
vfwcap.c Ramiro Polla
|
||||
xv.c Lukasz Marek
|
||||
|
||||
@@ -342,7 +343,6 @@ Filters:
|
||||
af_compand.c Paul B Mahol
|
||||
af_ladspa.c Paul B Mahol
|
||||
af_pan.c Nicolas George
|
||||
af_silenceremove.c Paul B Mahol
|
||||
avf_avectorscope.c Paul B Mahol
|
||||
avf_showcqt.c Muhammad Faiz
|
||||
vf_blend.c Paul B Mahol
|
||||
@@ -353,9 +353,7 @@ Filters:
|
||||
vf_extractplanes.c Paul B Mahol
|
||||
vf_histogram.c Paul B Mahol
|
||||
vf_hqx.c Clément Bœsch
|
||||
vf_idet.c Pascal Massimino
|
||||
vf_il.c Paul B Mahol
|
||||
vf_lenscorrection.c Daniel Oberhoff
|
||||
vf_mergeplanes.c Paul B Mahol
|
||||
vf_psnr.c Paul B Mahol
|
||||
vf_scale.c Michael Niedermayer
|
||||
@@ -460,15 +458,12 @@ Muxers/Demuxers:
|
||||
rmdec.c, rmenc.c Ronald S. Bultje, Kostya Shishkov
|
||||
rtmp* Kostya Shishkov
|
||||
rtp.c, rtpenc.c Martin Storsjo
|
||||
rtpdec_h261.*, rtpenc_h261.* Thomas Volkert
|
||||
rtpdec_hevc.* Thomas Volkert
|
||||
rtpdec_asf.* Ronald S. Bultje
|
||||
rtpenc_mpv.*, rtpenc_aac.* Martin Storsjo
|
||||
rtsp.c Luca Barbato
|
||||
sbgdec.c Nicolas George
|
||||
sdp.c Martin Storsjo
|
||||
segafilm.c Mike Melanson
|
||||
segment.c Stefano Sabatini
|
||||
siff.c Kostya Shishkov
|
||||
smacker.c Kostya Shishkov
|
||||
smjpeg* Paul B Mahol
|
||||
@@ -533,6 +528,10 @@ x86 Michael Niedermayer
|
||||
Releases
|
||||
========
|
||||
|
||||
2.2 Michael Niedermayer
|
||||
2.1 Michael Niedermayer
|
||||
1.2 Michael Niedermayer
|
||||
|
||||
If you want to maintain an older release, please contact us
|
||||
|
||||
|
||||
|
7
Makefile
7
Makefile
@@ -63,7 +63,7 @@ FF_DEP_LIBS := $(DEP_LIBS)
|
||||
all: $(AVPROGS)
|
||||
|
||||
$(TOOLS): %$(EXESUF): %.o $(EXEOBJS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS)
|
||||
$(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS)
|
||||
|
||||
tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)
|
||||
tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
|
||||
@@ -92,7 +92,6 @@ $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
|
||||
SUBDIR := $(1)/
|
||||
include $(SRC_PATH)/$(1)/Makefile
|
||||
-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
|
||||
-include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
|
||||
include $(SRC_PATH)/library.mak
|
||||
endef
|
||||
|
||||
@@ -111,14 +110,14 @@ endef
|
||||
|
||||
$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
|
||||
|
||||
ffprobe.o cmdutils.o libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
|
||||
ffprobe.o cmdutils.o : libavutil/ffversion.h
|
||||
|
||||
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
|
||||
$(CP) $< $@
|
||||
$(STRIP) $@
|
||||
|
||||
%$(PROGSSUF)_g$(EXESUF): %.o $(FF_DEP_LIBS)
|
||||
$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
|
||||
$(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
|
||||
|
||||
OBJDIRS += tools
|
||||
|
||||
|
41
README.md
41
README.md
@@ -1,40 +1,19 @@
|
||||
FFmpeg README
|
||||
=============
|
||||
|
||||
FFmpeg is a collection of libraries and tools to process multimedia content
|
||||
such as audio, video, subtitles and related metadata.
|
||||
1) Documentation
|
||||
----------------
|
||||
|
||||
## Libraries
|
||||
* Read the documentation in the doc/ directory in git.
|
||||
|
||||
* `libavcodec` provides implementation of a wider range of codecs.
|
||||
* `libavformat` implements streaming protocols, container formats and basic I/O access.
|
||||
* `libavutil` includes hashers, decompressors and miscellaneous utility functions.
|
||||
* `libavfilter` provides a mean to alter decoded Audio and Video through chain of filters.
|
||||
* `libavdevice` provides an abstraction to access capture and playback devices.
|
||||
* `libswresample` implements audio mixing and resampling routines.
|
||||
* `libswscale` implements color conversion and scaling routines.
|
||||
You can also view it online at http://ffmpeg.org/documentation.html
|
||||
|
||||
## Tools
|
||||
2) Licensing
|
||||
------------
|
||||
|
||||
* [ffmpeg](http://ffmpeg.org/ffmpeg.html) is a command line toolbox to
|
||||
manipulate, convert and stream multimedia content.
|
||||
* [ffplay](http://ffmpeg.org/ffplay.html) is a minimalistic multimedia player.
|
||||
* [ffprobe](http://ffmpeg.org/ffprobe.html) is a simple analisys tool to inspect
|
||||
multimedia content.
|
||||
* Additional small tools such as `aviocat`, `ismindex` and `qt-faststart`.
|
||||
* See the LICENSE file.
|
||||
|
||||
## Documentation
|
||||
3) Build and Install
|
||||
--------------------
|
||||
|
||||
The offline documentation is available in the **doc/** directory.
|
||||
|
||||
The online documentation is available in the main [website](http://ffmpeg.org)
|
||||
and in the [wiki](http://trac.ffmpeg.org).
|
||||
|
||||
### Examples
|
||||
|
||||
Conding examples are available in the **doc/example** directory.
|
||||
|
||||
## License
|
||||
|
||||
FFmpeg codebase is mainly LGPL-licensed with optional components licensed under
|
||||
GPL. Please refer to the LICENSE file for detailed information.
|
||||
* See the INSTALL file.
|
||||
|
200
RELEASE_NOTES
200
RELEASE_NOTES
@@ -1,83 +1,177 @@
|
||||
┌────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 2.4 "Fresnel" │
|
||||
└────────────────────────────────────────┘
|
||||
┌───────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 2.3 "Mandelbrot" │
|
||||
└───────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 2.4 "Fresnel", just 2 months
|
||||
after the release of 2.3. Since this wasn't a long time ago, the Changelog
|
||||
is a bit short this time.
|
||||
The FFmpeg Project proudly presents FFmpeg 2.3 "Mandelbrot", a major
|
||||
release with all the great features committed during the three-month period
|
||||
since the release of FFmpeg 2.2.
|
||||
|
||||
The most important thing in this release is the major version bump of the
|
||||
libraries. This means that this release is neither ABI-compatible nor
|
||||
fully API-compatible. But on the other hand it is aligned with the Libav
|
||||
11 release series, and will as a result probably end up being maintained for
|
||||
a long time.
|
||||
In this release, there are lots of internal overhauls that make FFmpeg a
|
||||
more accessible project for new developers. Many important new
|
||||
optimizations and features like QTKit and AVFoundation input devices are
|
||||
committed. Contributions done by Libav such as a new native Opus decoder
|
||||
are also merged.
|
||||
|
||||
As usual, if you have any question on this release or any FFmpeg related
|
||||
topic, feel free to join us on the #ffmpeg IRC channel (on
|
||||
irc.freenode.net).
|
||||
Because of the increasing difficulty to maintain and lack of maintainers,
|
||||
we are very sorry to say that we have removed all Blackfin and SPARC
|
||||
architecture assembly optimizations with the cleanups done. If you are
|
||||
interested in maintaining optimization for these two architecture, feel
|
||||
free to contact us and we will restore the code!
|
||||
|
||||
Oh, and since this release, this modern-looking release note is provided in
|
||||
addition to the old-style Changelog file, to make it easier for you to
|
||||
focus on the most important features in this release.
|
||||
|
||||
Enjoy!
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ 🔨 API Information │
|
||||
│ * API Information │
|
||||
└────────────────────────────┘
|
||||
|
||||
FFmpeg 2.4 includes the following library versions:
|
||||
FFmpeg 2.3 is completely source-compatible to the FFmpeg 2.2 series. There
|
||||
are however some API deprecations that you need to take care of. Use `git
|
||||
diff n2.2 n2.3 doc/APIchanges` to show the list of added and deprecated
|
||||
APIs. FFmpeg 2.3 includes the following library versions:
|
||||
|
||||
• libavutil 54.7.100
|
||||
• libavcodec 56.1.100
|
||||
• libavformat 56.4.101
|
||||
• libavdevice 56.0.100
|
||||
• libavfilter 5.1.100
|
||||
• libswscale 3.0.100
|
||||
• libswresample 1.1.100
|
||||
• libpostproc 53.0.100
|
||||
• libavutil 52.92.100
|
||||
• libavcodec 55.69.100
|
||||
• libavformat 55.48.100
|
||||
• libavdevice 55.13.102
|
||||
• libavfilter 4.11.100
|
||||
• libswscale 2. 6.100
|
||||
• libswresample 0.19.100
|
||||
• libpostproc 52. 3.100
|
||||
|
||||
Important API changes since 2.3:
|
||||
Please refer to the doc/APIChanges file for more information.
|
||||
|
||||
• The new field mime_type was added to AVProbeData, which can
|
||||
cause crashes, if it is not initialized.
|
||||
• Some deprecated functions were removed.
|
||||
• The avfilter_graph_parse function was made compatible with Libav.
|
||||
• The Matroska demuxer now outputs verbatim ASS packets.
|
||||
┌────────────────────────────┐
|
||||
│ New Optimization │
|
||||
└────────────────────────────┘
|
||||
|
||||
Please refer to the doc/APIchanges file for more information.
|
||||
We are excited to announce that we have committed new x86 assembly
|
||||
optimization for HEVC, and FFmpeg's audio resampler libswresample. ARM
|
||||
users will get a boost in MLP/TrueHD decoding thanks to new optimization.
|
||||
Decoding Huffyuv also got a major boost from optimization on the C code.
|
||||
|
||||
Of special interest for Microsoft Visual Studio users, we have also
|
||||
converted some preexisting x86 assembly to NASM/Yasm format compatible
|
||||
with MSVC setup, especially in the area of audio resampling.
|
||||
|
||||
Another major feature in this release is the introduction of AArch64
|
||||
(ARMv8) assembly optimization. AArch64 is another name for the first
|
||||
64-bit ARM architecture, used by Apple A7 SoC inside iPhone 5S. Some
|
||||
32-bit ARM assembly has already been ported to AArch64, but more work is
|
||||
underway.
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ Native Opus decoder │
|
||||
└────────────────────────────┘
|
||||
|
||||
Opus is an open audio format jointly developed by Xiph.Org, Mozilla,
|
||||
Skype/Microsoft, and Broadcom. It combines the features of the Skype Cilk
|
||||
speech codec and the Xiph.Org CELT music codec into one low-latency
|
||||
codec. Decoding Opus is already possible since FFmpeg 1.0 using the
|
||||
libopus library, but the new Opus native decoder brings a higher level of
|
||||
stability and speed.
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ QTKit and AVFoundation │
|
||||
└────────────────────────────┘
|
||||
|
||||
For OS X users, the new QTKit and AVFoundation devices allow you to use
|
||||
the integrated camera on Macs. AVFoundation is a newer API only available
|
||||
on OS X 10.7 "Lion" or newer. For users with older OS X systems, the
|
||||
QTKit device using the older OS X API is for you.
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ API Additions │
|
||||
└────────────────────────────┘
|
||||
|
||||
In this release, stream side data are introduced as AVStream.side_data as
|
||||
a way to store miscellaneous stream-wide information. The format is
|
||||
similar to the previously anonymous structure AVPacket.side_data (now
|
||||
named as AVPacketSideData). With this change, audio ReplayGain
|
||||
information and video rotation matrix are now exported through this API,
|
||||
if available in the demuxer.
|
||||
|
||||
We also have improved libswresample's Doxygen API documentation, so new
|
||||
developers wishing to use FFmpeg's excellent libraries can get started
|
||||
more easily and faster.
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ Last But Not Least │
|
||||
└────────────────────────────┘
|
||||
|
||||
Other interesting new features including hqx video filter, a pixel art
|
||||
scaling filter; a fixed-point AC-3 decoder contributed by Imagination
|
||||
Technologies; an On2 TrueMotion VP7 video decoder; an HTML5 WebVTT
|
||||
subtitle decoder that allows creation of WebVTT from any text-based
|
||||
subtitles; and an 1-bit Direct Stream Digital audio decoder.
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ ★ List of New Features │
|
||||
└────────────────────────────┘
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ Command line tools │
|
||||
└────────────────────────────┘
|
||||
|
||||
• Support for decoding through DXVA2 in ffmpeg
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libavcodec │
|
||||
└────────────────────────────┘
|
||||
|
||||
• AC3 fixed-point decoding
|
||||
• VP7 video decoder
|
||||
• Alias PIX image encoder and decoder
|
||||
• Improvements to the BRender PIX image decoder
|
||||
• Improvements to the XBM decoder
|
||||
• Improvements to OpenEXR image decoder
|
||||
• Support decoding 16-bit RLE SGI images
|
||||
• Direct Stream Digital (DSD) decoder
|
||||
• On2 AVC (Audio for Video) decoder
|
||||
• Native Opus decoder
|
||||
• WebVTT encoder
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libavdevice │
|
||||
└────────────────────────────┘
|
||||
|
||||
• QTKit input device
|
||||
• GDI screen grabbing for Windows
|
||||
• AVFoundation input device
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libavformat │
|
||||
└────────────────────────────┘
|
||||
|
||||
• Icecast protocol.
|
||||
• API for live metadata updates through event flags.
|
||||
• UTF-16 support in text subtitles formats.
|
||||
• The ASS muxer now reorders the Dialogue events properly.
|
||||
• support for H.261 RTP payload format (RFC 4587)
|
||||
• HEVC/H.265 RTP payload format (draft v6) depacketizer
|
||||
• subfile protocol
|
||||
• Phantom Cine demuxer
|
||||
• Alternative rendition support for HTTP Live Streaming
|
||||
• Magic Lantern Video (MLV) demuxer
|
||||
• Image format auto-detection
|
||||
• LRC lyric file demuxer and muxer
|
||||
• Samba protocol (via libsmbclient)
|
||||
• WebM DASH Manifest muxer
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libavfilter │
|
||||
└────────────────────────────┘
|
||||
|
||||
• Ported lenscorrection filter from frei0r filter.
|
||||
• Large optimizations in dctdnoiz to make it usable.
|
||||
• Added codecview filter to visualize information exported by some codecs.
|
||||
• Added silenceremove filter.
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libavutil │
|
||||
└────────────────────────────┘
|
||||
|
||||
• Added clip() function in eval.
|
||||
• shuffleplanes filter
|
||||
• libbs2b-based stereo-to-binaural audio filter
|
||||
• showcqt multimedia filter
|
||||
• zoompan filter
|
||||
• signalstats filter
|
||||
• hqx filter (hq2x, hq3x, hq4x)
|
||||
• flanger filter
|
||||
• libfribidi support in drawtext
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ ⚠ Behaviour changes │
|
||||
└────────────────────────────┘
|
||||
|
||||
• dctdnoiz filter now uses a block size of 8x8 instead of 16x16 by default
|
||||
• -vismv option is deprecated in favor of the codecview filter
|
||||
• libmodplug is now detected through pkg-config
|
||||
• HTML documentation generation through texi2html is deprecated in
|
||||
favor of makeinfo/texi2any
|
||||
• ICY metadata are now requested by default with the HTTP protocol
|
||||
• libx264 reference frames count is now limited depending on level chosen
|
||||
• Because of the new image format auto-detection feature, you don't need to
|
||||
specify image format when decoding an image with no extension.
|
||||
|
56
cmdutils.c
56
cmdutils.c
@@ -166,7 +166,7 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
|
||||
int first;
|
||||
|
||||
first = 1;
|
||||
for (po = options; po->name; po++) {
|
||||
for (po = options; po->name != NULL; po++) {
|
||||
char buf[64];
|
||||
|
||||
if (((po->flags & req_flags) != req_flags) ||
|
||||
@@ -205,7 +205,7 @@ static const OptionDef *find_option(const OptionDef *po, const char *name)
|
||||
const char *p = strchr(name, ':');
|
||||
int len = p ? p - name : strlen(name);
|
||||
|
||||
while (po->name) {
|
||||
while (po->name != NULL) {
|
||||
if (!strncmp(name, po->name, len) && strlen(po->name) == len)
|
||||
break;
|
||||
po++;
|
||||
@@ -254,7 +254,7 @@ static void prepare_app_arguments(int *argc_ptr, char ***argv_ptr)
|
||||
|
||||
win32_argv_utf8 = av_mallocz(sizeof(char *) * (win32_argc + 1) + buffsize);
|
||||
argstr_flat = (char *)win32_argv_utf8 + sizeof(char *) * (win32_argc + 1);
|
||||
if (!win32_argv_utf8) {
|
||||
if (win32_argv_utf8 == NULL) {
|
||||
LocalFree(argv_w);
|
||||
return;
|
||||
}
|
||||
@@ -444,7 +444,7 @@ int locate_option(int argc, char **argv, const OptionDef *options,
|
||||
(po->name && !strcmp(optname, po->name)))
|
||||
return i;
|
||||
|
||||
if (!po->name || po->flags & HAS_ARG)
|
||||
if (po->flags & HAS_ARG)
|
||||
i++;
|
||||
}
|
||||
return 0;
|
||||
@@ -1242,7 +1242,7 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg,
|
||||
is_dev = is_device(ofmt->priv_class);
|
||||
if (!is_dev && device_only)
|
||||
continue;
|
||||
if ((!name || strcmp(ofmt->name, name) < 0) &&
|
||||
if ((name == NULL || strcmp(ofmt->name, name) < 0) &&
|
||||
strcmp(ofmt->name, last_name) > 0) {
|
||||
name = ofmt->name;
|
||||
long_name = ofmt->long_name;
|
||||
@@ -1253,7 +1253,7 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg,
|
||||
is_dev = is_device(ifmt->priv_class);
|
||||
if (!is_dev && device_only)
|
||||
continue;
|
||||
if ((!name || strcmp(ifmt->name, name) < 0) &&
|
||||
if ((name == NULL || strcmp(ifmt->name, name) < 0) &&
|
||||
strcmp(ifmt->name, last_name) > 0) {
|
||||
name = ifmt->name;
|
||||
long_name = ifmt->long_name;
|
||||
@@ -1262,7 +1262,7 @@ static int show_formats_devices(void *optctx, const char *opt, const char *arg,
|
||||
if (name && strcmp(ifmt->name, name) == 0)
|
||||
decode = 1;
|
||||
}
|
||||
if (!name)
|
||||
if (name == NULL)
|
||||
break;
|
||||
last_name = name;
|
||||
|
||||
@@ -1639,19 +1639,19 @@ int show_layouts(void *optctx, const char *opt, const char *arg)
|
||||
const char *name, *descr;
|
||||
|
||||
printf("Individual channels:\n"
|
||||
"NAME DESCRIPTION\n");
|
||||
"NAME DESCRIPTION\n");
|
||||
for (i = 0; i < 63; i++) {
|
||||
name = av_get_channel_name((uint64_t)1 << i);
|
||||
if (!name)
|
||||
continue;
|
||||
descr = av_get_channel_description((uint64_t)1 << i);
|
||||
printf("%-14s %s\n", name, descr);
|
||||
printf("%-12s%s\n", name, descr);
|
||||
}
|
||||
printf("\nStandard channel layouts:\n"
|
||||
"NAME DECOMPOSITION\n");
|
||||
"NAME DECOMPOSITION\n");
|
||||
for (i = 0; !av_get_standard_channel_layout(i, &layout, &name); i++) {
|
||||
if (name) {
|
||||
printf("%-14s ", name);
|
||||
printf("%-12s", name);
|
||||
for (j = 1; j; j <<= 1)
|
||||
if ((layout & j))
|
||||
printf("%s%s", (layout & (j - 1)) ? "+" : "", av_get_channel_name(j));
|
||||
@@ -1857,7 +1857,7 @@ int read_yesno(void)
|
||||
|
||||
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
||||
{
|
||||
int64_t ret;
|
||||
int ret;
|
||||
FILE *f = av_fopen_utf8(filename, "rb");
|
||||
|
||||
if (!f) {
|
||||
@@ -1865,31 +1865,19 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
||||
strerror(errno));
|
||||
return AVERROR(errno);
|
||||
}
|
||||
|
||||
ret = fseek(f, 0, SEEK_END);
|
||||
if (ret == -1) {
|
||||
ret = AVERROR(errno);
|
||||
goto out;
|
||||
fseek(f, 0, SEEK_END);
|
||||
*size = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
if (*size == (size_t)-1) {
|
||||
av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", strerror(errno));
|
||||
fclose(f);
|
||||
return AVERROR(errno);
|
||||
}
|
||||
|
||||
ret = ftell(f);
|
||||
if (ret < 0) {
|
||||
ret = AVERROR(errno);
|
||||
goto out;
|
||||
}
|
||||
*size = ret;
|
||||
|
||||
ret = fseek(f, 0, SEEK_SET);
|
||||
if (ret == -1) {
|
||||
ret = AVERROR(errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
*bufptr = av_malloc(*size + 1);
|
||||
if (!*bufptr) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Could not allocate file buffer\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto out;
|
||||
fclose(f);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
ret = fread(*bufptr, 1, *size, f);
|
||||
if (ret < *size) {
|
||||
@@ -1905,8 +1893,6 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
||||
(*bufptr)[(*size)++] = '\0';
|
||||
}
|
||||
|
||||
out:
|
||||
av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", av_err2str(ret));
|
||||
fclose(f);
|
||||
return ret;
|
||||
}
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include "libavutil/time.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/opencl.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "cmdutils.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -239,8 +238,7 @@ int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
|
||||
devices[count].platform_idx = i;
|
||||
devices[count].device_idx = j;
|
||||
devices[count].runtime = score;
|
||||
av_strlcpy(devices[count].device_name, device_node->device_name,
|
||||
sizeof(devices[count].device_name));
|
||||
strcpy(devices[count].device_name, device_node->device_name);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
@@ -805,7 +805,7 @@ struct AVS_Library {
|
||||
|
||||
AVSC_INLINE AVS_Library * avs_load_library() {
|
||||
AVS_Library *library = (AVS_Library *)malloc(sizeof(AVS_Library));
|
||||
if (!library)
|
||||
if (library == NULL)
|
||||
return NULL;
|
||||
library->handle = LoadLibrary("avisynth");
|
||||
if (library->handle == NULL)
|
||||
@@ -870,7 +870,7 @@ fail:
|
||||
}
|
||||
|
||||
AVSC_INLINE void avs_free_library(AVS_Library *library) {
|
||||
if (!library)
|
||||
if (library == NULL)
|
||||
return;
|
||||
FreeLibrary(library->handle);
|
||||
free(library);
|
||||
|
@@ -54,7 +54,7 @@ static int getopt(int argc, char *argv[], char *opts)
|
||||
}
|
||||
}
|
||||
optopt = c = argv[optind][sp];
|
||||
if (c == ':' || !(cp = strchr(opts, c))) {
|
||||
if (c == ':' || (cp = strchr(opts, c)) == NULL) {
|
||||
fprintf(stderr, ": illegal option -- %c\n", c);
|
||||
if (argv[optind][++sp] == '\0') {
|
||||
optind++;
|
||||
|
@@ -39,7 +39,6 @@
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/mem.h"
|
||||
@@ -74,29 +73,17 @@ static BOOL (WINAPI *cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
#define cond_broadcast WakeAllConditionVariable
|
||||
#define cond_signal WakeConditionVariable
|
||||
#define cond_wait SleepConditionVariableCS
|
||||
|
||||
#define CreateEvent(a, reset, init, name) \
|
||||
CreateEventEx(a, name, \
|
||||
(reset ? CREATE_EVENT_MANUAL_RESET : 0) | \
|
||||
(init ? CREATE_EVENT_INITIAL_SET : 0), \
|
||||
EVENT_ALL_ACCESS)
|
||||
// CreateSemaphoreExA seems to be desktop-only, but as long as we don't
|
||||
// use named semaphores, it doesn't matter if we use the W version.
|
||||
#define CreateSemaphore(a, b, c, d) \
|
||||
CreateSemaphoreExW(a, b, c, d, 0, SEMAPHORE_ALL_ACCESS)
|
||||
#define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
|
||||
#define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
|
||||
#endif
|
||||
|
||||
static av_unused unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
|
||||
static unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
|
||||
{
|
||||
pthread_t *h = arg;
|
||||
h->ret = h->func(h->arg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_unused int pthread_create(pthread_t *thread, const void *unused_attr,
|
||||
void *(*start_routine)(void*), void *arg)
|
||||
static int pthread_create(pthread_t *thread, const void *unused_attr,
|
||||
void *(*start_routine)(void*), void *arg)
|
||||
{
|
||||
thread->func = start_routine;
|
||||
thread->arg = arg;
|
||||
@@ -105,7 +92,7 @@ static av_unused int pthread_create(pthread_t *thread, const void *unused_attr,
|
||||
return !thread->handle;
|
||||
}
|
||||
|
||||
static av_unused void pthread_join(pthread_t thread, void **value_ptr)
|
||||
static void pthread_join(pthread_t thread, void **value_ptr)
|
||||
{
|
||||
DWORD ret = WaitForSingleObject(thread.handle, INFINITE);
|
||||
if (ret != WAIT_OBJECT_0)
|
||||
@@ -147,7 +134,7 @@ typedef struct win32_cond_t {
|
||||
volatile int is_broadcast;
|
||||
} win32_cond_t;
|
||||
|
||||
static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
|
||||
static int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
|
||||
{
|
||||
win32_cond_t *win32_cond = NULL;
|
||||
if (cond_init) {
|
||||
@@ -172,7 +159,7 @@ static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_unused void pthread_cond_destroy(pthread_cond_t *cond)
|
||||
static void pthread_cond_destroy(pthread_cond_t *cond)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->ptr;
|
||||
/* native condition variables do not destroy */
|
||||
@@ -188,7 +175,7 @@ static av_unused void pthread_cond_destroy(pthread_cond_t *cond)
|
||||
cond->ptr = NULL;
|
||||
}
|
||||
|
||||
static av_unused void pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
static void pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->ptr;
|
||||
int have_waiter;
|
||||
@@ -219,7 +206,7 @@ static av_unused void pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
pthread_mutex_unlock(&win32_cond->mtx_broadcast);
|
||||
}
|
||||
|
||||
static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
|
||||
static int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->ptr;
|
||||
int last_waiter;
|
||||
@@ -251,7 +238,7 @@ static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mu
|
||||
return pthread_mutex_lock(mutex);
|
||||
}
|
||||
|
||||
static av_unused void pthread_cond_signal(pthread_cond_t *cond)
|
||||
static void pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->ptr;
|
||||
int have_waiter;
|
||||
@@ -276,7 +263,7 @@ static av_unused void pthread_cond_signal(pthread_cond_t *cond)
|
||||
pthread_mutex_unlock(&win32_cond->mtx_broadcast);
|
||||
}
|
||||
|
||||
static av_unused void w32thread_init(void)
|
||||
static void w32thread_init(void)
|
||||
{
|
||||
#if _WIN32_WINNT < 0x0600
|
||||
HANDLE kernel_dll = GetModuleHandle(TEXT("kernel32.dll"));
|
||||
|
254
configure
vendored
254
configure
vendored
@@ -89,7 +89,6 @@ Standard options:
|
||||
--mandir=DIR install man page in DIR [PREFIX/share/man]
|
||||
--enable-rpath use rpath to allow installing libraries in paths
|
||||
not part of the dynamic linker search path
|
||||
use rpath when linking programs [USE WITH CARE]
|
||||
|
||||
Licensing options:
|
||||
--enable-gpl allow use of GPL code, the resulting libs
|
||||
@@ -145,8 +144,6 @@ Component options:
|
||||
--disable-mdct disable MDCT code
|
||||
--disable-rdft disable RDFT code
|
||||
--disable-fft disable FFT code
|
||||
--disable-faan disable floating point AAN (I)DCT code
|
||||
--disable-pixelutils disable pixel utils in libavutil
|
||||
|
||||
Hardware accelerators:
|
||||
--disable-dxva2 disable DXVA2 code [autodetect]
|
||||
@@ -255,7 +252,6 @@ External library support:
|
||||
native MPEG-4/Xvid encoder exists [no]
|
||||
--enable-libzmq enable message passing via libzmq [no]
|
||||
--enable-libzvbi enable teletext support via libzvbi [no]
|
||||
--disable-lzma disable lzma [autodetect]
|
||||
--enable-decklink enable Blackmagick DeckLink output [no]
|
||||
--enable-openal enable OpenAL 1.1 capture support [no]
|
||||
--enable-opencl enable OpenCL code
|
||||
@@ -303,7 +299,6 @@ Toolchain options:
|
||||
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
|
||||
--extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
|
||||
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
|
||||
--extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
|
||||
--extra-libs=ELIBS add ELIBS [$ELIBS]
|
||||
--extra-version=STRING version string suffix []
|
||||
--optflags=OPTFLAGS override optimization-related compiler flags
|
||||
@@ -320,6 +315,7 @@ Advanced options (experts only):
|
||||
disable buffer boundary checking in bitreaders
|
||||
(faster, but may crash)
|
||||
--enable-memalign-hack emulate memalign, interferes with memory debuggers
|
||||
--enable-sram allow use of on-chip SRAM
|
||||
--sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
|
||||
|
||||
Optimization options (experts only):
|
||||
@@ -762,10 +758,6 @@ add_ldflags(){
|
||||
append LDFLAGS $($ldflags_filter "$@")
|
||||
}
|
||||
|
||||
add_ldexeflags(){
|
||||
append LDEXEFLAGS $($ldflags_filter "$@")
|
||||
}
|
||||
|
||||
add_stripflags(){
|
||||
append ASMSTRIPFLAGS "$@"
|
||||
}
|
||||
@@ -1244,7 +1236,7 @@ check_host_cpp(){
|
||||
log check_host_cpp "$@"
|
||||
cat > $TMPC
|
||||
log_file $TMPC
|
||||
check_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
|
||||
check_cmd $host_cc $HOSTCPPFLAGS $HOSTCFLAGS "$@" $(hostcc_e $TMPO) $TMPC
|
||||
}
|
||||
|
||||
check_host_cppflags(){
|
||||
@@ -1308,7 +1300,6 @@ EXAMPLE_LIST="
|
||||
avio_reading_example
|
||||
decoding_encoding_example
|
||||
demuxing_decoding_example
|
||||
extract_mvs_example
|
||||
filter_audio_example
|
||||
filtering_audio_example
|
||||
filtering_video_example
|
||||
@@ -1383,7 +1374,6 @@ EXTERNAL_LIBRARY_LIST="
|
||||
libxvid
|
||||
libzmq
|
||||
libzvbi
|
||||
lzma
|
||||
openal
|
||||
opencl
|
||||
opengl
|
||||
@@ -1409,6 +1399,7 @@ FEATURE_LIST="
|
||||
safe_bitstream_reader
|
||||
shared
|
||||
small
|
||||
sram
|
||||
static
|
||||
swscale_alpha
|
||||
"
|
||||
@@ -1450,13 +1441,11 @@ SUBSYSTEM_LIST="
|
||||
dct
|
||||
dwt
|
||||
error_resilience
|
||||
faan
|
||||
fast_unaligned
|
||||
fft
|
||||
lsp
|
||||
lzo
|
||||
mdct
|
||||
pixelutils
|
||||
network
|
||||
rdft
|
||||
"
|
||||
@@ -1531,7 +1520,6 @@ ARCH_EXT_LIST_ARM="
|
||||
neon
|
||||
vfp
|
||||
vfpv3
|
||||
setend
|
||||
"
|
||||
|
||||
ARCH_EXT_LIST_MIPS="
|
||||
@@ -1589,7 +1577,6 @@ ARCH_FEATURES="
|
||||
local_aligned_8
|
||||
local_aligned_16
|
||||
local_aligned_32
|
||||
simd_align_16
|
||||
"
|
||||
|
||||
BUILTIN_LIST="
|
||||
@@ -1620,6 +1607,7 @@ HEADERS_LIST="
|
||||
asm_types_h
|
||||
cdio_paranoia_h
|
||||
cdio_paranoia_paranoia_h
|
||||
CL_cl_h
|
||||
dev_bktr_ioctl_bt848_h
|
||||
dev_bktr_ioctl_meteor_h
|
||||
dev_ic_bt8xx_h
|
||||
@@ -1654,10 +1642,6 @@ HEADERS_LIST="
|
||||
winsock2_h
|
||||
"
|
||||
|
||||
INTRINSICS_LIST="
|
||||
intrinsics_neon
|
||||
"
|
||||
|
||||
MATH_FUNCS="
|
||||
atanf
|
||||
atan2f
|
||||
@@ -1667,6 +1651,7 @@ MATH_FUNCS="
|
||||
exp2
|
||||
exp2f
|
||||
expf
|
||||
fminf
|
||||
isinf
|
||||
isnan
|
||||
ldexpf
|
||||
@@ -1742,7 +1727,6 @@ SYSTEM_FUNCS="
|
||||
TOOLCHAIN_FEATURES="
|
||||
as_dn_directive
|
||||
as_func
|
||||
as_object_arch
|
||||
asm_mod_q
|
||||
attribute_may_alias
|
||||
attribute_packed
|
||||
@@ -1789,7 +1773,6 @@ HAVE_LIST="
|
||||
$HAVE_LIST_CMDLINE
|
||||
$HAVE_LIST_PUB
|
||||
$HEADERS_LIST
|
||||
$INTRINSICS_LIST
|
||||
$MATH_FUNCS
|
||||
$SYSTEM_FUNCS
|
||||
$THREADS_LIST
|
||||
@@ -1803,7 +1786,6 @@ HAVE_LIST="
|
||||
libdc1394_1
|
||||
libdc1394_2
|
||||
makeinfo
|
||||
makeinfo_html
|
||||
perl
|
||||
pod2man
|
||||
sdl
|
||||
@@ -1822,10 +1804,9 @@ CONFIG_EXTRA="
|
||||
blockdsp
|
||||
bswapdsp
|
||||
cabac
|
||||
dsputil
|
||||
dvprofile
|
||||
exif
|
||||
faandct
|
||||
faanidct
|
||||
fdctdsp
|
||||
frame_thread_encoder
|
||||
gcrypt
|
||||
@@ -1841,13 +1822,11 @@ CONFIG_EXTRA="
|
||||
huffyuvdsp
|
||||
huffyuvencdsp
|
||||
idctdsp
|
||||
iirfilter
|
||||
intrax8
|
||||
lgplv3
|
||||
llauddsp
|
||||
llviddsp
|
||||
lpc
|
||||
me_cmp
|
||||
mpeg_er
|
||||
mpegaudio
|
||||
mpegaudiodsp
|
||||
@@ -1862,11 +1841,9 @@ CONFIG_EXTRA="
|
||||
rtpdec
|
||||
rtpenc_chain
|
||||
sinewin
|
||||
startcode
|
||||
tpeldsp
|
||||
videodsp
|
||||
vp3dsp
|
||||
wma_freqs
|
||||
"
|
||||
|
||||
CMDLINE_SELECT="
|
||||
@@ -1958,10 +1935,8 @@ armv6_deps="arm"
|
||||
armv6t2_deps="arm"
|
||||
armv8_deps="aarch64"
|
||||
neon_deps_any="aarch64 arm"
|
||||
intrinsics_neon_deps="neon"
|
||||
vfp_deps_any="aarch64 arm"
|
||||
vfpv3_deps="vfp"
|
||||
setend_deps="arm"
|
||||
|
||||
map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
|
||||
|
||||
@@ -2010,7 +1985,8 @@ aligned_stack_if_any="aarch64 ppc x86"
|
||||
fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
|
||||
fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
|
||||
fast_unaligned_if_any="aarch64 ppc x86"
|
||||
simd_align_16_if_any="altivec neon sse"
|
||||
|
||||
need_memalign="altivec neon sse"
|
||||
|
||||
# system capabilities
|
||||
|
||||
@@ -2026,28 +2002,26 @@ threads_if_any="$THREADS_LIST"
|
||||
|
||||
# subsystems
|
||||
dct_select="rdft"
|
||||
error_resilience_select="me_cmp"
|
||||
faandct_deps="faan fdctdsp"
|
||||
faanidct_deps="faan idctdsp"
|
||||
dsputil_select="fdctdsp idctdsp pixblockdsp"
|
||||
error_resilience_select="dsputil"
|
||||
frame_thread_encoder_deps="encoders threads"
|
||||
intrax8_select="error_resilience"
|
||||
mdct_select="fft"
|
||||
rdft_select="fft"
|
||||
me_cmp_select="fdctdsp idctdsp pixblockdsp"
|
||||
mpeg_er_select="error_resilience"
|
||||
mpegaudio_select="mpegaudiodsp"
|
||||
mpegaudiodsp_select="dct"
|
||||
mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp me_cmp videodsp"
|
||||
mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp"
|
||||
mpegvideo_select="blockdsp dsputil h264chroma hpeldsp idctdsp videodsp"
|
||||
mpegvideoenc_select="dsputil mpegvideo pixblockdsp qpeldsp"
|
||||
|
||||
# decoders / encoders
|
||||
aac_decoder_select="mdct sinewin"
|
||||
aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
|
||||
aac_encoder_select="audio_frame_queue mdct sinewin"
|
||||
aac_latm_decoder_select="aac_decoder aac_latm_parser"
|
||||
ac3_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
|
||||
ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct"
|
||||
ac3_encoder_select="ac3dsp audiodsp mdct me_cmp"
|
||||
ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp"
|
||||
ac3_encoder_select="ac3dsp audiodsp dsputil mdct"
|
||||
ac3_fixed_encoder_select="ac3dsp audiodsp dsputil mdct"
|
||||
aic_decoder_select="golomb idctdsp"
|
||||
alac_encoder_select="lpc"
|
||||
als_decoder_select="bswapdsp"
|
||||
@@ -2065,8 +2039,8 @@ atrac3_decoder_select="mdct"
|
||||
atrac3p_decoder_select="mdct sinewin"
|
||||
avrn_decoder_select="exif"
|
||||
bink_decoder_select="blockdsp hpeldsp"
|
||||
binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
|
||||
binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
|
||||
binkaudio_dct_decoder_select="mdct rdft dct sinewin"
|
||||
binkaudio_rdft_decoder_select="mdct rdft sinewin"
|
||||
cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
|
||||
cllc_decoder_select="bswapdsp"
|
||||
comfortnoise_encoder_select="lpc"
|
||||
@@ -2074,11 +2048,11 @@ cook_decoder_select="audiodsp mdct sinewin"
|
||||
cscd_decoder_select="lzo"
|
||||
cscd_decoder_suggest="zlib"
|
||||
dca_decoder_select="mdct"
|
||||
dirac_decoder_select="dwt golomb videodsp mpegvideoenc"
|
||||
dirac_decoder_select="dsputil dwt golomb videodsp mpegvideoenc"
|
||||
dnxhd_decoder_select="blockdsp idctdsp"
|
||||
dnxhd_encoder_select="aandcttables blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp"
|
||||
dvvideo_decoder_select="dvprofile idctdsp"
|
||||
dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
|
||||
dvvideo_encoder_select="dsputil dvprofile fdctdsp pixblockdsp"
|
||||
dxa_decoder_select="zlib"
|
||||
eac3_decoder_select="ac3_decoder"
|
||||
eac3_encoder_select="ac3_encoder"
|
||||
@@ -2109,7 +2083,7 @@ h263_decoder_select="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpel
|
||||
h263_encoder_select="aandcttables h263dsp mpegvideoenc"
|
||||
h263i_decoder_select="h263_decoder"
|
||||
h263p_encoder_select="h263_encoder"
|
||||
h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel startcode videodsp"
|
||||
h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel videodsp"
|
||||
h264_decoder_suggest="error_resilience"
|
||||
hevc_decoder_select="bswapdsp cabac golomb videodsp"
|
||||
huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
|
||||
@@ -2146,7 +2120,6 @@ mpc7_decoder_select="bswapdsp mpegaudiodsp"
|
||||
mpc8_decoder_select="mpegaudiodsp"
|
||||
mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
|
||||
mpeg_xvmc_decoder_select="mpeg2video_decoder"
|
||||
mpegvideo_decoder_select="error_resilience mpeg_er mpegvideo"
|
||||
mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
|
||||
mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp"
|
||||
mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
|
||||
@@ -2174,8 +2147,8 @@ qdm2_decoder_select="mdct rdft mpegaudiodsp"
|
||||
ra_144_encoder_select="audio_frame_queue lpc audiodsp"
|
||||
ra_144_decoder_select="audiodsp"
|
||||
ralf_decoder_select="golomb"
|
||||
rawvideo_decoder_select="bswapdsp"
|
||||
rtjpeg_decoder_select="me_cmp"
|
||||
rawvideo_decoder_select="dsputil bswapdsp"
|
||||
rtjpeg_decoder_select="dsputil"
|
||||
rv10_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
|
||||
rv10_encoder_select="h263_encoder"
|
||||
rv20_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
|
||||
@@ -2184,20 +2157,20 @@ rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_e
|
||||
rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp"
|
||||
shorten_decoder_select="golomb"
|
||||
sipr_decoder_select="lsp"
|
||||
snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp"
|
||||
snow_encoder_select="aandcttables dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder"
|
||||
snow_decoder_select="dsputil dwt h264qpel hpeldsp rangecoder mpegvideoenc"
|
||||
snow_encoder_select="aandcttables dsputil dwt h264qpel hpeldsp mpegvideoenc rangecoder"
|
||||
sonic_decoder_select="golomb rangecoder"
|
||||
sonic_encoder_select="golomb rangecoder"
|
||||
sonic_ls_encoder_select="golomb rangecoder"
|
||||
sp5x_decoder_select="mjpeg_decoder"
|
||||
svq1_decoder_select="hpeldsp"
|
||||
svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc"
|
||||
svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
|
||||
svq3_decoder_select="h264_decoder hpeldsp tpeldsp"
|
||||
svq3_decoder_suggest="zlib"
|
||||
tak_decoder_select="audiodsp"
|
||||
theora_decoder_select="vp3_decoder"
|
||||
thp_decoder_select="mjpeg_decoder"
|
||||
tiff_decoder_suggest="zlib lzma"
|
||||
tiff_decoder_suggest="zlib"
|
||||
tiff_encoder_suggest="zlib"
|
||||
truehd_decoder_select="mlp_parser"
|
||||
truemotion2_decoder_select="bswapdsp"
|
||||
@@ -2207,7 +2180,7 @@ twinvq_decoder_select="mdct lsp sinewin"
|
||||
utvideo_decoder_select="bswapdsp"
|
||||
utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
|
||||
vble_decoder_select="huffyuvdsp"
|
||||
vc1_decoder_select="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp startcode"
|
||||
vc1_decoder_select="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp"
|
||||
vc1image_decoder_select="vc1_decoder"
|
||||
vorbis_decoder_select="mdct"
|
||||
vorbis_encoder_select="mdct"
|
||||
@@ -2221,11 +2194,11 @@ vp8_decoder_select="h264pred videodsp"
|
||||
vp9_decoder_select="videodsp vp9_parser"
|
||||
webp_decoder_select="vp8_decoder"
|
||||
wmalossless_decoder_select="llauddsp"
|
||||
wmapro_decoder_select="mdct sinewin wma_freqs"
|
||||
wmav1_decoder_select="mdct sinewin wma_freqs"
|
||||
wmav1_encoder_select="mdct sinewin wma_freqs"
|
||||
wmav2_decoder_select="mdct sinewin wma_freqs"
|
||||
wmav2_encoder_select="mdct sinewin wma_freqs"
|
||||
wmapro_decoder_select="mdct sinewin"
|
||||
wmav1_decoder_select="mdct sinewin"
|
||||
wmav1_encoder_select="mdct sinewin"
|
||||
wmav2_decoder_select="mdct sinewin"
|
||||
wmav2_encoder_select="mdct sinewin"
|
||||
wmavoice_decoder_select="lsp rdft dct mdct sinewin"
|
||||
wmv1_decoder_select="h263_decoder"
|
||||
wmv1_encoder_select="h263_encoder"
|
||||
@@ -2314,7 +2287,7 @@ h264_parser_select="h264_decoder"
|
||||
hevc_parser_select="hevc_decoder"
|
||||
mpegvideo_parser_select="mpegvideo"
|
||||
mpeg4video_parser_select="error_resilience h263dsp mpeg_er mpegvideo qpeldsp"
|
||||
vc1_parser_select="mpegvideo startcode vc1_decoder"
|
||||
vc1_parser_select="mpegvideo vc1_decoder"
|
||||
|
||||
# external libraries
|
||||
libaacplus_encoder_deps="libaacplus"
|
||||
@@ -2417,9 +2390,7 @@ mpegtsraw_demuxer_select="mpegts_demuxer"
|
||||
mxf_d10_muxer_select="mxf_muxer"
|
||||
nut_muxer_select="riffenc"
|
||||
nuv_demuxer_select="riffdec"
|
||||
oga_muxer_select="ogg_muxer"
|
||||
ogg_demuxer_select="golomb"
|
||||
opus_muxer_select="ogg_muxer"
|
||||
psp_muxer_select="mov_muxer"
|
||||
rtp_demuxer_select="sdp_demuxer"
|
||||
rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
|
||||
@@ -2430,7 +2401,6 @@ sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
|
||||
sdp_demuxer_select="rtpdec"
|
||||
smoothstreaming_muxer_select="ismv_muxer"
|
||||
spdif_muxer_select="aac_parser"
|
||||
spx_muxer_select="ogg_muxer"
|
||||
tak_demuxer_select="tak_parser"
|
||||
tg2_muxer_select="mov_muxer"
|
||||
tgp_muxer_select="mov_muxer"
|
||||
@@ -2501,7 +2471,6 @@ gopher_protocol_select="network"
|
||||
http_protocol_select="tcp_protocol"
|
||||
httpproxy_protocol_select="tcp_protocol"
|
||||
https_protocol_select="tls_protocol"
|
||||
icecast_protocol_select="http_protocol"
|
||||
librtmp_protocol_deps="librtmp"
|
||||
librtmpe_protocol_deps="librtmp"
|
||||
librtmps_protocol_deps="librtmp"
|
||||
@@ -2544,8 +2513,11 @@ boxblur_filter_deps="gpl"
|
||||
bs2b_filter_deps="libbs2b"
|
||||
colormatrix_filter_deps="gpl"
|
||||
cropdetect_filter_deps="gpl"
|
||||
dctdnoiz_filter_deps="avcodec"
|
||||
dctdnoiz_filter_select="dct"
|
||||
delogo_filter_deps="gpl"
|
||||
deshake_filter_select="pixelutils"
|
||||
deshake_filter_deps="avcodec"
|
||||
deshake_filter_select="dsputil"
|
||||
drawtext_filter_deps="libfreetype"
|
||||
ebur128_filter_deps="gpl"
|
||||
flite_filter_deps="libflite"
|
||||
@@ -2563,8 +2535,8 @@ ladspa_filter_extralibs='$ldl'
|
||||
mcdeint_filter_deps="avcodec gpl"
|
||||
movie_filter_deps="avcodec avformat"
|
||||
mp_filter_deps="gpl avcodec swscale inline_asm"
|
||||
mpdecimate_filter_deps="gpl"
|
||||
mpdecimate_filter_select="pixelutils"
|
||||
mpdecimate_filter_deps="gpl avcodec"
|
||||
mpdecimate_filter_select="dsputil pixblockdsp"
|
||||
mptestsrc_filter_deps="gpl"
|
||||
negate_filter_deps="lut_filter"
|
||||
perspective_filter_deps="gpl"
|
||||
@@ -2578,12 +2550,11 @@ removelogo_filter_deps="avcodec avformat swscale"
|
||||
resample_filter_deps="avresample"
|
||||
sab_filter_deps="gpl swscale"
|
||||
scale_filter_deps="swscale"
|
||||
select_filter_select="pixelutils"
|
||||
smartblur_filter_deps="gpl swscale"
|
||||
showspectrum_filter_deps="avcodec"
|
||||
showspectrum_filter_select="rdft"
|
||||
spp_filter_deps="gpl avcodec"
|
||||
spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
|
||||
spp_filter_select="dsputil fft idctdsp fdctdsp pixblockdsp"
|
||||
stereo3d_filter_deps="gpl"
|
||||
subtitles_filter_deps="avformat avcodec libass"
|
||||
super2xsai_filter_deps="gpl"
|
||||
@@ -2599,9 +2570,7 @@ zoompan_filter_deps="swscale"
|
||||
# examples
|
||||
avio_reading="avformat avcodec avutil"
|
||||
avcodec_example_deps="avcodec avutil"
|
||||
decoding_encoding_example_deps="avcodec avformat avutil"
|
||||
demuxing_decoding_example_deps="avcodec avformat avutil"
|
||||
extract_mvs_example_deps="avcodec avformat avutil"
|
||||
filter_audio_example_deps="avfilter avutil"
|
||||
filtering_audio_example_deps="avfilter avcodec avformat avutil"
|
||||
filtering_video_example_deps="avfilter avcodec avformat avutil"
|
||||
@@ -2638,8 +2607,7 @@ ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
|
||||
# documentation
|
||||
podpages_deps="perl"
|
||||
manpages_deps="perl pod2man"
|
||||
htmlpages_deps="perl"
|
||||
htmlpages_deps_any="makeinfo_html texi2html"
|
||||
htmlpages_deps="perl texi2html"
|
||||
txtpages_deps="perl makeinfo"
|
||||
doc_deps_any="manpages htmlpages podpages txtpages"
|
||||
|
||||
@@ -2674,6 +2642,8 @@ strip_default="strip"
|
||||
yasmexe_default="yasm"
|
||||
windres_default="windres"
|
||||
|
||||
nogas=":"
|
||||
|
||||
# OS
|
||||
target_os_default=$(tolower $(uname -s))
|
||||
host_os=$target_os_default
|
||||
@@ -2686,7 +2656,6 @@ else
|
||||
arch_default=$(uname -m)
|
||||
fi
|
||||
cpu="generic"
|
||||
intrinsics="none"
|
||||
|
||||
# configurable options
|
||||
enable $PROGRAM_LIST
|
||||
@@ -2698,7 +2667,6 @@ enable stripping
|
||||
enable asm
|
||||
enable debug
|
||||
enable doc
|
||||
enable faan faandct faanidct
|
||||
enable optimizations
|
||||
enable runtime_cpudetect
|
||||
enable safe_bitstream_reader
|
||||
@@ -2860,9 +2828,6 @@ for opt do
|
||||
--extra-ldflags=*)
|
||||
add_ldflags $optval
|
||||
;;
|
||||
--extra-ldexeflags=*)
|
||||
add_ldexeflags $optval
|
||||
;;
|
||||
--extra-libs=*)
|
||||
add_extralibs $optval
|
||||
;;
|
||||
@@ -3122,17 +3087,6 @@ EOF
|
||||
die "Sanity test failed."
|
||||
fi
|
||||
|
||||
armasm_flags(){
|
||||
for flag; do
|
||||
case $flag in
|
||||
# Filter out MSVC cl.exe options from cflags that shouldn't
|
||||
# be passed to gas-preprocessor
|
||||
-M[TD]*) ;;
|
||||
*) echo $flag ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
ccc_flags(){
|
||||
for flag; do
|
||||
case $flag in
|
||||
@@ -3197,7 +3151,7 @@ msvc_flags(){
|
||||
-wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
|
||||
-wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
|
||||
-wd4554 \
|
||||
-wd4273 -wd4701 ;;
|
||||
-wd4273 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
@@ -3361,7 +3315,7 @@ probe_cc(){
|
||||
elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
|
||||
test -d "$sysroot" || die "No valid sysroot specified."
|
||||
_type=armcc
|
||||
_ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
|
||||
_ident=$($_cc --vsn | head -n1 | sed 's/.*: //')
|
||||
armcc_conf="$PWD/armcc.conf"
|
||||
$_cc --arm_linux_configure \
|
||||
--arm_linux_config_file="$armcc_conf" \
|
||||
@@ -3421,12 +3375,6 @@ probe_cc(){
|
||||
_cflags_size="-O2 -Munroll=c:1 $opt_common"
|
||||
_cflags_noopt="-O"
|
||||
_flags_filter=pgi_flags
|
||||
elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
|
||||
_type=armasm
|
||||
_ident=$($_cc | head -n1)
|
||||
# 4509: "This form of conditional instruction is deprecated"
|
||||
_flags="-nologo -ignore 4509"
|
||||
_flags_filter=armasm_flags
|
||||
elif $_cc 2>&1 | grep -q Microsoft; then
|
||||
_type=msvc
|
||||
_ident=$($cc 2>&1 | head -n1)
|
||||
@@ -3841,7 +3789,6 @@ elif enabled x86; then
|
||||
case $cpu in
|
||||
i[345]86|pentium)
|
||||
cpuflags="-march=$cpu"
|
||||
disable i686
|
||||
disable mmx
|
||||
;;
|
||||
# targets that do NOT support nopl and conditional mov (cmov)
|
||||
@@ -3933,9 +3880,6 @@ case "$arch" in
|
||||
;;
|
||||
x86)
|
||||
check_64bit x86_32 x86_64 'sizeof(void *) > 4'
|
||||
# Treat x32 as x64 for now. Note it also needs spic=$shared
|
||||
test "$subarch" = "x86_32" && check_cpp_condition stddef.h 'defined(__x86_64__)' &&
|
||||
subarch=x86_64
|
||||
if test "$subarch" = "x86_64"; then
|
||||
spic=$shared
|
||||
fi
|
||||
@@ -4007,6 +3951,7 @@ case $target_os in
|
||||
strip="strip -d"
|
||||
;;
|
||||
darwin)
|
||||
test "${as#*gas-preprocessor.pl}" != "$as" || gas="${gas:=gas-preprocessor.pl} ${as:=$cc}"
|
||||
enabled ppc && add_asflags -force_cpusubtype_ALL
|
||||
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
|
||||
enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
|
||||
@@ -4123,10 +4068,11 @@ case $target_os in
|
||||
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
|
||||
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
|
||||
SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
|
||||
echo PROTMODE >> $(SUBDIR)$(NAME).def; \
|
||||
echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
|
||||
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
|
||||
echo EXPORTS >> $(SUBDIR)$(NAME).def; \
|
||||
emxexp $(OBJS) >> $(SUBDIR)$(NAME).def'
|
||||
emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
|
||||
SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
|
||||
emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
|
||||
SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
|
||||
@@ -4380,55 +4326,26 @@ if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] ;then
|
||||
fi
|
||||
fi
|
||||
|
||||
check_gas() {
|
||||
log "check_gas using '$as' as AS"
|
||||
# :vararg is used on aarch64, arm and ppc altivec
|
||||
check_as <<EOF || return 1
|
||||
.macro m n, y:vararg=0
|
||||
\n: .int \y
|
||||
|
||||
if enabled asm; then
|
||||
enabled arm && nogas=die
|
||||
enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
|
||||
as=${gas:=$as}
|
||||
check_as <<EOF && enable gnu_as || \
|
||||
$nogas "GNU assembler not found, install gas-preprocessor"
|
||||
.macro m n
|
||||
\n: .int 0
|
||||
.endm
|
||||
m x
|
||||
EOF
|
||||
# .altmacro is only used in arm asm
|
||||
! enabled arm || check_as <<EOF || return 1
|
||||
|
||||
check_as <<EOF || $nogas "GNU assembler not found, install gas-preprocessor"
|
||||
.altmacro
|
||||
EOF
|
||||
enable gnu_as
|
||||
return 0
|
||||
}
|
||||
|
||||
if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
|
||||
nogas=:
|
||||
enabled_any arm aarch64 && nogas=die
|
||||
enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
|
||||
as_noop=-v
|
||||
|
||||
case $as_type in
|
||||
arm*) gaspp_as_type=armasm; as_noop=-h ;;
|
||||
gcc) gaspp_as_type=gas ;;
|
||||
*) gaspp_as_type=$as_type ;;
|
||||
esac
|
||||
|
||||
[ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
|
||||
|
||||
test "${as#*gas-preprocessor.pl}" != "$as" ||
|
||||
check_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
|
||||
gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
|
||||
|
||||
if ! check_gas ; then
|
||||
as=${gas:=$as}
|
||||
check_gas || \
|
||||
$nogas "GNU assembler not found, install/update gas-preprocessor"
|
||||
fi
|
||||
|
||||
check_as <<EOF && enable as_func
|
||||
.func test
|
||||
.endfunc
|
||||
EOF
|
||||
|
||||
# llvm's integrated assembler supports .object_arch from llvm 3.5
|
||||
enabled arm && test "$objformat" = elf && check_as <<EOF && enable as_object_arch
|
||||
.object_arch armv4
|
||||
EOF
|
||||
fi
|
||||
|
||||
@@ -4475,9 +4392,8 @@ EOF
|
||||
enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
|
||||
enabled vfp && check_insn vfp 'fadds s0, s0, s0'
|
||||
enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
|
||||
enabled setend && check_insn setend 'setend be'
|
||||
|
||||
[ $target_os = linux ] || [ $target_os = android ] ||
|
||||
[ $target_os = linux ] ||
|
||||
map 'enabled_any ${v}_external ${v}_inline || disable $v' \
|
||||
$ARCH_EXT_LIST_ARM
|
||||
|
||||
@@ -4506,7 +4422,7 @@ elif enabled parisc; then
|
||||
|
||||
if enabled gcc; then
|
||||
case $($cc -dumpversion) in
|
||||
4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
|
||||
4.[3-8].*) check_cflags -fno-optimize-sibling-calls ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -4611,10 +4527,7 @@ EOF
|
||||
|
||||
fi
|
||||
|
||||
check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
|
||||
|
||||
check_ldflags -Wl,--as-needed
|
||||
check_ldflags -Wl,-z,noexecstack
|
||||
|
||||
if check_func dlopen; then
|
||||
ldl=
|
||||
@@ -4673,7 +4586,7 @@ check_func ${malloc_prefix}memalign && enable memalign
|
||||
check_func ${malloc_prefix}posix_memalign && enable posix_memalign
|
||||
|
||||
check_func access
|
||||
check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt; }
|
||||
check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; }
|
||||
check_func fcntl
|
||||
check_func fork
|
||||
check_func gethrtime
|
||||
@@ -4687,7 +4600,7 @@ check_func mkstemp
|
||||
check_func mmap
|
||||
check_func mprotect
|
||||
# Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
|
||||
check_func_headers time.h nanosleep || { check_func_headers time.h nanosleep -lrt && add_extralibs -lrt; }
|
||||
check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
|
||||
check_func sched_getaffinity
|
||||
check_func setrlimit
|
||||
check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
|
||||
@@ -4714,6 +4627,7 @@ check_func_headers glob.h glob
|
||||
enabled xlib &&
|
||||
check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
|
||||
|
||||
check_header cl/cl.h
|
||||
check_header direct.h
|
||||
check_header dlfcn.h
|
||||
check_header dxva.h
|
||||
@@ -4779,7 +4693,6 @@ fi
|
||||
|
||||
disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
|
||||
disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
|
||||
disabled lzma || check_lib2 lzma.h lzma_version_number -llzma || disable lzma
|
||||
|
||||
check_lib math.h sin -lm && LIBM="-lm"
|
||||
disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
|
||||
@@ -4787,6 +4700,7 @@ disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersi
|
||||
atan2f_args=2
|
||||
ldexpf_args=2
|
||||
powf_args=2
|
||||
fminf_args=2
|
||||
|
||||
for func in $MATH_FUNCS; do
|
||||
eval check_mathfunc $func \${${func}_args:-1}
|
||||
@@ -4823,7 +4737,7 @@ enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
|
||||
check_lib "${gsm_hdr}" gsm_create -lgsm && break;
|
||||
done || die "ERROR: libgsm not found"; }
|
||||
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
|
||||
enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
|
||||
enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
|
||||
enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
|
||||
enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
|
||||
enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
|
||||
@@ -4833,7 +4747,7 @@ enabled libopenjpeg && { check_lib openjpeg-1.5/openjpeg.h opj_version -lo
|
||||
check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
|
||||
die "ERROR: libopenjpeg not found"; }
|
||||
enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
|
||||
enabled libpulse && require_pkg_config libpulse pulse/pulseaudio.h pa_context_new
|
||||
enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
|
||||
enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init
|
||||
enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
|
||||
enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
|
||||
@@ -4843,7 +4757,7 @@ enabled libsmbclient && { { check_pkg_config smbclient libsmbclient.h smbc_
|
||||
require smbclient libsmbclient.h smbc_init -lsmbclient; }
|
||||
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
|
||||
enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
|
||||
enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
|
||||
enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
|
||||
enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
|
||||
media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
|
||||
media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
|
||||
@@ -4863,11 +4777,9 @@ enabled libvpx && {
|
||||
enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
|
||||
die "ERROR: libvpx encoder version must be >=0.9.7"; }
|
||||
enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
|
||||
enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_AQ_MODE" -lvpx || disable libvpx_vp9_encoder; } }
|
||||
enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VP9E_SET_SVC" -lvpx || disable libvpx_vp9_encoder; } }
|
||||
enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
|
||||
enabled libwebp && require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion &&
|
||||
{ check_code cc webp/encode.h "WebPPicture wp; wp.use_argb++" ||
|
||||
die "ERROR: libwebp too old."; }
|
||||
enabled libwebp && require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion
|
||||
enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
|
||||
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
|
||||
die "ERROR: libx264 must be installed and version must be >= 0.118."; }
|
||||
@@ -4932,11 +4844,8 @@ else
|
||||
fi
|
||||
enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
|
||||
|
||||
texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
|
||||
makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
|
||||
enabled makeinfo && (makeinfo --version | \
|
||||
grep -q 'makeinfo (GNU texinfo) 5' > /dev/null 2>&1) \
|
||||
&& enable makeinfo_html || disable makeinfo_html
|
||||
disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
|
||||
perl -v > /dev/null 2>&1 && enable perl || disable perl
|
||||
pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
|
||||
rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
|
||||
@@ -4947,7 +4856,6 @@ check_header linux/videodev2.h
|
||||
check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
|
||||
|
||||
check_header sys/videoio.h
|
||||
check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
|
||||
|
||||
check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
|
||||
# check that WM_CAP_DRIVER_CONNECT is defined to the proper value
|
||||
@@ -4987,7 +4895,7 @@ enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
|
||||
if enabled libcdio; then
|
||||
check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
|
||||
check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
|
||||
die "ERROR: No usable libcdio/cdparanoia found"
|
||||
die "ERROR: libcdio-paranoia not found"
|
||||
fi
|
||||
|
||||
enabled xlib &&
|
||||
@@ -5056,7 +4964,7 @@ check_disable_warning -Wno-pointer-sign
|
||||
# add some linker flags
|
||||
check_ldflags -Wl,--warn-common
|
||||
check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
|
||||
enabled rpath && add_ldexeflags -Wl,-rpath,$libdir
|
||||
enabled rpath && add_ldflags -Wl,-rpath,$libdir
|
||||
test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
|
||||
|
||||
# add some strip flags
|
||||
@@ -5265,7 +5173,7 @@ enabled_all dxva2 dxva2api_cobj CoTaskMemFree &&
|
||||
enable dxva2_lib
|
||||
|
||||
! enabled_any memalign posix_memalign aligned_malloc &&
|
||||
enabled simd_align_16 && enable memalign_hack
|
||||
enabled_any $need_memalign && enable memalign_hack
|
||||
|
||||
# add_dep lib dep
|
||||
# -> enable ${lib}_deps_${dep}
|
||||
@@ -5294,8 +5202,6 @@ merge_deps() {
|
||||
|
||||
merge_deps libavfilter $FILTER_LIST
|
||||
|
||||
map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
|
||||
|
||||
for thread in $THREADS_LIST; do
|
||||
if enabled $thread; then
|
||||
test -n "$thread_type" &&
|
||||
@@ -5304,14 +5210,14 @@ for thread in $THREADS_LIST; do
|
||||
fi
|
||||
done
|
||||
|
||||
enabled zlib && add_cppflags -DZLIB_CONST
|
||||
|
||||
# conditional library dependencies, in linking order
|
||||
enabled aconvert_filter && prepend avfilter_deps "swresample"
|
||||
enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
|
||||
enabled aresample_filter && prepend avfilter_deps "swresample"
|
||||
enabled asyncts_filter && prepend avfilter_deps "avresample"
|
||||
enabled atempo_filter && prepend avfilter_deps "avcodec"
|
||||
enabled decimate_filter && prepend avfilter_deps "avcodec"
|
||||
enabled deshake_filter && prepend avfilter_deps "avcodec"
|
||||
enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
|
||||
enabled elbg_filter && prepend avfilter_deps "avcodec"
|
||||
enabled mcdeint_filter && prepend avfilter_deps "avcodec"
|
||||
@@ -5421,7 +5327,6 @@ echo "texi2html enabled ${texi2html-no}"
|
||||
echo "perl enabled ${perl-no}"
|
||||
echo "pod2man enabled ${pod2man-no}"
|
||||
echo "makeinfo enabled ${makeinfo-no}"
|
||||
echo "makeinfo supports HTML ${makeinfo_html-no}"
|
||||
test -n "$random_seed" &&
|
||||
echo "random seed ${random_seed}"
|
||||
echo
|
||||
@@ -5477,7 +5382,6 @@ SRC_PATH:=\$(SRC_PATH:.%=..%)
|
||||
endif
|
||||
CC_IDENT=$cc_ident
|
||||
ARCH=$arch
|
||||
INTRINSICS=$intrinsics
|
||||
CC=$cc
|
||||
CXX=$cxx
|
||||
AS=$as
|
||||
@@ -5514,7 +5418,6 @@ WINDRES=$windres
|
||||
DEPWINDRES=$dep_cc
|
||||
DOXYGEN=$doxygen
|
||||
LDFLAGS=$LDFLAGS
|
||||
LDEXEFLAGS=$LDEXEFLAGS
|
||||
SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
|
||||
ASMSTRIPFLAGS=$ASMSTRIPFLAGS
|
||||
YASMFLAGS=$YASMFLAGS
|
||||
@@ -5603,7 +5506,7 @@ cat > $TMPH <<EOF
|
||||
#define FFMPEG_CONFIG_H
|
||||
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
|
||||
#define FFMPEG_LICENSE "$(c_escape $license)"
|
||||
#define CONFIG_THIS_YEAR 2016
|
||||
#define CONFIG_THIS_YEAR 2014
|
||||
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
|
||||
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
|
||||
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
|
||||
@@ -5631,7 +5534,6 @@ enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
|
||||
|
||||
|
||||
mkdir -p doc
|
||||
mkdir -p tests
|
||||
echo "@c auto-generated by configure" > doc/config.texi
|
||||
|
||||
print_config ARCH_ "$config_files" $ARCH_LIST
|
||||
@@ -5724,6 +5626,6 @@ pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVF
|
||||
pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
|
||||
pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
|
||||
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
|
||||
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
|
||||
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
|
||||
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
|
||||
pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"
|
||||
|
196
doc/APIchanges
196
doc/APIchanges
@@ -2,128 +2,19 @@ Never assume the API of libav* to be stable unless at least 1 month has passed
|
||||
since the last major version increase or the API was added.
|
||||
|
||||
The last version increases were:
|
||||
libavcodec: 2014-08-09
|
||||
libavdevice: 2014-08-09
|
||||
libavfilter: 2014-08-09
|
||||
libavformat: 2014-08-09
|
||||
libavresample: 2014-08-09
|
||||
libpostproc: 2014-08-09
|
||||
libswresample: 2014-08-09
|
||||
libswscale: 2014-08-09
|
||||
libavutil: 2014-08-09
|
||||
libavcodec: 2013-03-xx
|
||||
libavdevice: 2013-03-xx
|
||||
libavfilter: 2013-12-xx
|
||||
libavformat: 2013-03-xx
|
||||
libavresample: 2012-10-05
|
||||
libpostproc: 2011-04-18
|
||||
libswresample: 2011-09-19
|
||||
libswscale: 2011-06-20
|
||||
libavutil: 2012-10-22
|
||||
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 2.4 was cut here -------- 8< ---------
|
||||
|
||||
2014-08-28 - f30a815 / 9301486 - lavc 56.1.100 / 56.1.0 - avcodec.h
|
||||
Add AV_PKT_DATA_STEREO3D to export container-level stereo3d information.
|
||||
|
||||
2014-08-25 - 215db29 / b263f8f - lavf 56.3.100 / 56.3.0 - avformat.h
|
||||
Add AVFormatContext.max_ts_probe.
|
||||
|
||||
2014-08-23 - 8fc9bd0 - lavu 54.7.100 - dict.h
|
||||
AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL arguments are now
|
||||
freed even on error. This is consistent with the behaviour all users
|
||||
of it we could find expect.
|
||||
|
||||
2014-08-21 - 980a5b0 - lavu 54.6.100 - frame.h motion_vector.h
|
||||
Add AV_FRAME_DATA_MOTION_VECTORS side data and AVMotionVector structure
|
||||
|
||||
2014-08-16 - b7d5e01 - lswr 1.1.100 - swresample.h
|
||||
Add AVFrame based API
|
||||
|
||||
2014-08-16 - c2829dc - lavu 54.4.100 - dict.h
|
||||
Add av_dict_set_int helper function.
|
||||
|
||||
2014-08-13 - c8571c6 / 8ddc326 - lavu 54.3.100 / 54.3.0 - mem.h
|
||||
Add av_strndup().
|
||||
|
||||
2014-08-13 - 2ba4577 / a8c104a - lavu 54.2.100 / 54.2.0 - opt.h
|
||||
Add av_opt_get_dict_val/set_dict_val with AV_OPT_TYPE_DICT to support
|
||||
dictionary types being set as options.
|
||||
|
||||
2014-08-13 - afbd4b8 - lavf 56.01.0 - avformat.h
|
||||
Add AVFormatContext.event_flags and AVStream.event_flags for signaling to
|
||||
the user when events happen in the file/stream.
|
||||
|
||||
2014-08-10 - 78eaaa8 / fb1ddcd - lavr 2.1.0 - avresample.h
|
||||
Add avresample_convert_frame() and avresample_config().
|
||||
|
||||
2014-08-10 - 78eaaa8 / fb1ddcd - lavu 54.1.100 / 54.1.0 - error.h
|
||||
Add AVERROR_INPUT_CHANGED and AVERROR_OUTPUT_CHANGED.
|
||||
|
||||
2014-08-08 - 3841f2a / d35b94f - lavc 55.73.102 / 55.57.4 - avcodec.h
|
||||
Deprecate FF_IDCT_XVIDMMX define and xvidmmx idct option.
|
||||
Replaced by FF_IDCT_XVID and xvid respectively.
|
||||
|
||||
2014-08-08 - 5c3c671 - lavf 55.53.100 - avio.h
|
||||
Add avio_feof() and deprecate url_feof().
|
||||
|
||||
2014-08-07 - bb78903 - lsws 2.1.3 - swscale.h
|
||||
sws_getContext is not going to be removed in the future.
|
||||
|
||||
2014-08-07 - a561662 / ad1ee5f - lavc 55.73.101 / 55.57.3 - avcodec.h
|
||||
reordered_opaque is not going to be removed in the future.
|
||||
|
||||
2014-08-02 - 28a2107 - lavu 52.98.100 - pixelutils.h
|
||||
Add pixelutils API with SAD functions
|
||||
|
||||
2014-08-04 - 6017c98 / e9abafc - lavu 52.97.100 / 53.22.0 - pixfmt.h
|
||||
Add AV_PIX_FMT_YA16 pixel format for 16 bit packed gray with alpha.
|
||||
|
||||
2014-08-04 - 4c8bc6f / e96c3b8 - lavu 52.96.101 / 53.21.1 - avstring.h
|
||||
Rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8 to better identify the format.
|
||||
An alias pixel format and color space name are provided for compatibility.
|
||||
|
||||
2014-08-04 - 073c074 / d2962e9 - lavu 52.96.100 / 53.21.0 - pixdesc.h
|
||||
Support name aliases for pixel formats.
|
||||
|
||||
2014-08-03 - 71d008e / 1ef9e83 - lavc 55.72.101 / 55.57.2 - avcodec.h
|
||||
2014-08-03 - 71d008e / 1ef9e83 - lavu 52.95.100 / 53.20.0 - frame.h
|
||||
Deprecate AVCodecContext.dtg_active_format and use side-data instead.
|
||||
|
||||
2014-08-03 - e680c73 - lavc 55.72.100 - avcodec.h
|
||||
Add get_pixels() to AVDCT
|
||||
|
||||
2014-08-03 - 9400603 / 9f17685 - lavc 55.71.101 / 55.57.1 - avcodec.h
|
||||
Deprecate unused FF_IDCT_IPP define and ipp avcodec option.
|
||||
Deprecate unused FF_DEBUG_PTS define and pts avcodec option.
|
||||
Deprecate unused FF_CODER_TYPE_DEFLATE define and deflate avcodec option.
|
||||
Deprecate unused FF_DCT_INT define and int avcodec option.
|
||||
Deprecate unused avcodec option scenechange_factor.
|
||||
|
||||
2014-07-30 - ba3e331 - lavu 52.94.100 - frame.h
|
||||
Add av_frame_side_data_name()
|
||||
|
||||
2014-07-29 - 80a3a66 / 3a19405 - lavf 56.01.100 / 56.01.0 - avformat.h
|
||||
Add mime_type field to AVProbeData, which now MUST be initialized in
|
||||
order to avoid uninitialized reads of the mime_type pointer, likely
|
||||
leading to crashes.
|
||||
Typically, this means you will do 'AVProbeData pd = { 0 };' instead of
|
||||
'AVProbeData pd;'.
|
||||
|
||||
2014-07-29 - 31e0b5d / 69e7336 - lavu 52.92.100 / 53.19.0 - avstring.h
|
||||
Make name matching function from lavf public as av_match_name().
|
||||
|
||||
2014-07-28 - 2e5c8b0 / c5fca01 - lavc 55.71.100 / 55.57.0 - avcodec.h
|
||||
Add AV_CODEC_PROP_REORDER to mark codecs supporting frame reordering.
|
||||
|
||||
2014-07-27 - ff9a154 - lavf 55.50.100 - avformat.h
|
||||
New field int64_t probesize2 instead of deprecated
|
||||
field int probesize.
|
||||
|
||||
2014-07-27 - 932ff70 - lavc 55.70.100 - avdct.h
|
||||
Add AVDCT / avcodec_dct_alloc() / avcodec_dct_init().
|
||||
|
||||
2014-07-23 - 8a4c086 - lavf 55.49.100 - avio.h
|
||||
Add avio_read_to_bprint()
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 2.3 was cut here -------- 8< ---------
|
||||
|
||||
2014-07-14 - 62227a7 - lavf 55.47.100 - avformat.h
|
||||
Add av_stream_get_parser()
|
||||
|
||||
@@ -144,11 +35,7 @@ API changes, most recent first:
|
||||
is now setting AVStream.time_base, instead of AVStream.codec.time_base as was
|
||||
done previously. The old method is now deprecated.
|
||||
|
||||
2014-06-11 - 67d29da - lavc 55.66.101 - avcodec.h
|
||||
Increase FF_INPUT_BUFFER_PADDING_SIZE to 32 due to some corner cases needing
|
||||
it
|
||||
|
||||
2014-06-10 - 5482780 - lavf 55.43.100 - avformat.h
|
||||
2014-06-10 - xxxxxxx - lavf 55.43.100 - avformat.h
|
||||
New field int64_t max_analyze_duration2 instead of deprecated
|
||||
int max_analyze_duration.
|
||||
|
||||
@@ -168,28 +55,28 @@ API changes, most recent first:
|
||||
2014-05-29 - bdb2e80 / b2d4565 - lavr 1.3.0 - avresample.h
|
||||
Add avresample_max_output_samples
|
||||
|
||||
2014-05-28 - d858ee7 / 6d21259 - lavf 55.42.100 / 55.19.0 - avformat.h
|
||||
2014-05-24 - d858ee7 / 6d21259 - lavf 55.42.100 / 55.19.0 - avformat.h
|
||||
Add strict_std_compliance and related AVOptions to support experimental
|
||||
muxing.
|
||||
|
||||
2014-05-26 - 55cc60c - lavu 52.87.100 - threadmessage.h
|
||||
2014-05-26 - xxxxxxx - lavu 52.87.100 - threadmessage.h
|
||||
Add thread message queue API.
|
||||
|
||||
2014-05-26 - c37d179 - lavf 55.41.100 - avformat.h
|
||||
Add format_probesize to AVFormatContext.
|
||||
|
||||
2014-05-20 - 7d25af1 / c23c96b - lavf 55.39.100 / 55.18.0 - avformat.h
|
||||
2014-05-19 - 7d25af1 / c23c96b - lavf 55.39.100 / 55.18.0 - avformat.h
|
||||
Add av_stream_get_side_data() to access stream-level side data
|
||||
in the same way as av_packet_get_side_data().
|
||||
|
||||
2014-05-20 - 7336e39 - lavu 52.86.100 - fifo.h
|
||||
2014-05-xx - xxxxxxx - lavu 52.86.100 - fifo.h
|
||||
Add av_fifo_alloc_array() function.
|
||||
|
||||
2014-05-19 - ef1d4ee / bddd8cb - lavu 52.85.100 / 53.15.0 - frame.h, display.h
|
||||
Add AV_FRAME_DATA_DISPLAYMATRIX for exporting frame-level
|
||||
spatial rendering on video frames for proper display.
|
||||
|
||||
2014-05-19 - ef1d4ee / bddd8cb - lavc 55.64.100 / 55.53.0 - avcodec.h
|
||||
2014-05-xx - xxxxxxx - lavc 55.64.100 / 55.53.0 - avcodec.h
|
||||
Add AV_PKT_DATA_DISPLAYMATRIX for exporting packet-level
|
||||
spatial rendering on video frames for proper display.
|
||||
|
||||
@@ -205,7 +92,7 @@ API changes, most recent first:
|
||||
Add av_gettime_relative() av_gettime_relative_is_monotonic()
|
||||
|
||||
2014-05-15 - eacf7d6 / 0c1959b - lavf 55.38.100 / 55.17.0 - avformat.h
|
||||
Add AVFMT_FLAG_BITEXACT flag. Muxers now use it instead of checking
|
||||
Add AVMFT_FLAG_BITEXACT flag. Muxers now use it instead of checking
|
||||
CODEC_FLAG_BITEXACT on the first stream.
|
||||
|
||||
2014-05-15 - 96cb4c8 - lswr 0.19.100 - swresample.h
|
||||
@@ -214,10 +101,10 @@ API changes, most recent first:
|
||||
2014-05-11 - 14aef38 / 66e6c8a - lavu 52.83.100 / 53.14.0 - pixfmt.h
|
||||
Add AV_PIX_FMT_VDA for new-style VDA acceleration.
|
||||
|
||||
2014-05-07 - 351f611 - lavu 52.82.100 - fifo.h
|
||||
2014-05-xx - xxxxxxx - lavu 52.82.0 - fifo.h
|
||||
Add av_fifo_freep() function.
|
||||
|
||||
2014-05-02 - ba52fb11 - lavu 52.81.100 - opt.h
|
||||
2014-05-02 - ba52fb11 - lavu 52.81.0 - opt.h
|
||||
Add av_opt_set_dict2() function.
|
||||
|
||||
2014-05-01 - e77b985 / a2941c8 - lavc 55.60.103 / 55.50.3 - avcodec.h
|
||||
@@ -236,14 +123,10 @@ API changes, most recent first:
|
||||
Deprecate CODEC_FLAG_INPUT_PRESERVED. Its functionality is replaced by passing
|
||||
reference-counted frames to encoders.
|
||||
|
||||
2014-04-30 - 617e866 - lavu 52.81.100 - pixdesc.h
|
||||
Add av_find_best_pix_fmt_of_2(), av_get_pix_fmt_loss()
|
||||
Deprecate avcodec_get_pix_fmt_loss(), avcodec_find_best_pix_fmt_of_2()
|
||||
|
||||
2014-04-29 - 1bf6396 - lavc 55.60.100 - avcodec.h
|
||||
Add AVCodecDescriptor.mime_types field.
|
||||
|
||||
2014-04-29 - b804eb4 - lavu 52.80.100 - hash.h
|
||||
2014-04-29 - xxxxxxx - lavu 52.80.0 - hash.h
|
||||
Add av_hash_final_bin(), av_hash_final_hex() and av_hash_final_b64().
|
||||
|
||||
2014-03-07 - 8b2a130 - lavc 55.50.0 / 55.53.100 - dxva2.h
|
||||
@@ -255,7 +138,7 @@ API changes, most recent first:
|
||||
2014-04-17 - a8d01a7 / 0983d48 - lavu 53.12.0 / 52.77.100 - crc.h
|
||||
Add AV_CRC_16_ANSI_LE crc variant.
|
||||
|
||||
2014-04-15 - ef818d8 - lavf 55.37.101 - avformat.h
|
||||
2014-04-XX - xxxxxxx - lavf xx.xx.1xx - avformat.h
|
||||
Add av_format_inject_global_side_data()
|
||||
|
||||
2014-04-12 - 4f698be - lavu 52.76.100 - log.h
|
||||
@@ -301,9 +184,6 @@ API changes, most recent first:
|
||||
Give the name AVPacketSideData to the previously anonymous struct used for
|
||||
AVPacket.side_data.
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 2.2 was cut here -------- 8< ---------
|
||||
|
||||
2014-03-18 - 37c07d4 - lsws 2.5.102
|
||||
Make gray16 full-scale.
|
||||
|
||||
@@ -335,7 +215,7 @@ API changes, most recent first:
|
||||
2014-02-19 - f4c8d00 / 6bb8720 - lavu 52.64.101 / 53.3.1 - opt.h
|
||||
Deprecate unused AV_OPT_FLAG_METADATA.
|
||||
|
||||
2014-02-16 - 81c3f81 - lavd 55.10.100 - avdevice.h
|
||||
2014-02-xx - xxxxxxx - lavd 55.10.100 - avdevice.h
|
||||
Add avdevice_list_devices() and avdevice_free_list_devices()
|
||||
|
||||
2014-02-16 - db3c970 - lavf 55.33.100 - avio.h
|
||||
@@ -376,7 +256,7 @@ API changes, most recent first:
|
||||
2014-01-19 - 1a193c4 - lavf 55.25.100 - avformat.h
|
||||
Add avformat_get_mov_video_tags() and avformat_get_mov_audio_tags().
|
||||
|
||||
2014-01-19 - 3532dd5 - lavu 52.63.100 - rational.h
|
||||
2014-01-19 - xxxxxxx - lavu 52.63.100 - rational.h
|
||||
Add av_make_q() function.
|
||||
|
||||
2014-01-05 - 4cf4da9 / 5b4797a - lavu 52.62.100 / 53.2.0 - frame.h
|
||||
@@ -446,9 +326,6 @@ API changes, most recent first:
|
||||
2013-10-31 - 78265fc / 28096e0 - lavu 52.49.100 / 52.17.0 - frame.h
|
||||
Add AVFrame.flags and AV_FRAME_FLAG_CORRUPT.
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 2.1 was cut here -------- 8< ---------
|
||||
|
||||
2013-10-27 - dbe6f9f - lavc 55.39.100 - avcodec.h
|
||||
Add CODEC_CAP_DELAY support to avcodec_decode_subtitle2.
|
||||
|
||||
@@ -521,9 +398,6 @@ API changes, most recent first:
|
||||
Add avcodec_chroma_pos_to_enum()
|
||||
Add avcodec_enum_to_chroma_pos()
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 2.0 was cut here -------- 8< ---------
|
||||
|
||||
2013-07-03 - 838bd73 - lavfi 3.78.100 - avfilter.h
|
||||
Deprecate avfilter_graph_parse() in favor of the equivalent
|
||||
avfilter_graph_parse_ptr().
|
||||
@@ -596,9 +470,6 @@ API changes, most recent first:
|
||||
2013-03-17 - 7aa9af5 - lavu 52.20.100 - opt.h
|
||||
Add AV_OPT_TYPE_VIDEO_RATE value to AVOptionType enum.
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 1.2 was cut here -------- 8< ---------
|
||||
|
||||
2013-03-07 - 9767ec6 - lavu 52.18.100 - avstring.h,bprint.h
|
||||
Add av_escape() and av_bprint_escape() API.
|
||||
|
||||
@@ -611,9 +482,6 @@ API changes, most recent first:
|
||||
2013-01-01 - 2eb2e17 - lavfi 3.34.100
|
||||
Add avfilter_get_audio_buffer_ref_from_arrays_channels.
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 1.1 was cut here -------- 8< ---------
|
||||
|
||||
2012-12-20 - 34de47aa - lavfi 3.29.100 - avfilter.h
|
||||
Add AVFilterLink.channels, avfilter_link_get_channels()
|
||||
and avfilter_ref_get_channels().
|
||||
@@ -659,9 +527,6 @@ API changes, most recent first:
|
||||
Add LIBSWRESAMPLE_VERSION, LIBSWRESAMPLE_BUILD
|
||||
and LIBSWRESAMPLE_IDENT symbols.
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 1.0 was cut here -------- 8< ---------
|
||||
|
||||
2012-09-06 - 29e972f - lavu 51.72.100 - parseutils.h
|
||||
Add av_small_strptime() time parsing function.
|
||||
|
||||
@@ -1080,9 +945,6 @@ lavd 54.4.100 / 54.0.0, lavfi 3.5.0
|
||||
2012-01-12 - b18e17e / 3167dc9 - lavfi 2.59.100 / 2.15.0
|
||||
Add a new installed header -- libavfilter/version.h -- with version macros.
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 0.9 was cut here -------- 8< ---------
|
||||
|
||||
2011-12-08 - a502939 - lavfi 2.52.0
|
||||
Add av_buffersink_poll_frame() to buffersink.h.
|
||||
|
||||
@@ -1292,13 +1154,6 @@ lavd 54.4.100 / 54.0.0, lavfi 3.5.0
|
||||
2011-06-28 - 5129336 - lavu 51.11.0 - avutil.h
|
||||
Define the AV_PICTURE_TYPE_NONE value in AVPictureType enum.
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 0.7 was cut here -------- 8< ---------
|
||||
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 0.8 was cut here -------- 8< ---------
|
||||
|
||||
2011-06-19 - fd2c0a5 - lavfi 2.23.0 - avfilter.h
|
||||
Add layout negotiation fields and helper functions.
|
||||
|
||||
@@ -1976,9 +1831,6 @@ lavd 54.4.100 / 54.0.0, lavfi 3.5.0
|
||||
2010-06-02 - 7e566bb - lavc 52.73.0 - av_get_codec_tag_string()
|
||||
Add av_get_codec_tag_string().
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 0.6 was cut here -------- 8< ---------
|
||||
|
||||
2010-06-01 - 2b99142 - lsws 0.11.0 - convertPalette API
|
||||
Add sws_convertPalette8ToPacked32() and sws_convertPalette8ToPacked24().
|
||||
|
||||
@@ -1996,6 +1848,10 @@ lavd 54.4.100 / 54.0.0, lavfi 3.5.0
|
||||
2010-05-09 - b6bc205 - lavfi 1.20.0 - AVFilterPicRef
|
||||
Add interlaced and top_field_first fields to AVFilterPicRef.
|
||||
|
||||
------------------------------8<-------------------------------------
|
||||
0.6 branch was cut here
|
||||
----------------------------->8--------------------------------------
|
||||
|
||||
2010-05-01 - 8e2ee18 - lavf 52.62.0 - probe function
|
||||
Add av_probe_input_format2 to API, it allows ignoring probe
|
||||
results below given score and returns the actual probe score.
|
||||
|
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 2.4.13
|
||||
PROJECT_NUMBER = 2.3
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
15
doc/Makefile
15
doc/Makefile
@@ -38,9 +38,7 @@ DOCS = $(DOCS-yes)
|
||||
|
||||
DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading
|
||||
DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE) += avcodec
|
||||
DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding
|
||||
DOC_EXAMPLES-$(CONFIG_DEMUXING_DECODING_EXAMPLE) += demuxing_decoding
|
||||
DOC_EXAMPLES-$(CONFIG_EXTRACT_MVS_EXAMPLE) += extract_mvs
|
||||
DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE) += filter_audio
|
||||
DOC_EXAMPLES-$(CONFIG_FILTERING_AUDIO_EXAMPLE) += filtering_audio
|
||||
DOC_EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE) += filtering_video
|
||||
@@ -82,25 +80,14 @@ $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
|
||||
$(M)doc/print_options $* > $@
|
||||
|
||||
doc/%.html: TAG = HTML
|
||||
doc/%-all.html: TAG = HTML
|
||||
|
||||
ifdef HAVE_MAKEINFO_HTML
|
||||
doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)makeinfo --html -I doc --no-split -D config-not-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
|
||||
|
||||
doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)makeinfo --html -I doc --no-split -D config-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
|
||||
else
|
||||
doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
|
||||
|
||||
doc/%-all.html: TAG = HTML
|
||||
doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
|
||||
$(Q)$(TEXIDEP)
|
||||
$(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
|
||||
endif
|
||||
|
||||
doc/%.pod: TAG = POD
|
||||
doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
|
||||
|
5
doc/bootstrap.min.css
vendored
5
doc/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -498,8 +498,6 @@ threading operations
|
||||
@item vismv @var{integer} (@emph{decoding,video})
|
||||
Visualize motion vectors (MVs).
|
||||
|
||||
This option is deprecated, see the codecview filter instead.
|
||||
|
||||
Possible values:
|
||||
@table @samp
|
||||
@item pf
|
||||
@@ -799,9 +797,6 @@ Frame data might be split into multiple chunks.
|
||||
Show all frames before the first keyframe.
|
||||
@item skiprd
|
||||
Deprecated, use mpegvideo private options instead.
|
||||
@item export_mvs
|
||||
Export motion vectors into frame side-data (see @code{AV_FRAME_DATA_MOTION_VECTORS})
|
||||
for codecs that support it. See also @file{doc/examples/export_mvs.c}.
|
||||
@end table
|
||||
|
||||
@item error @var{integer} (@emph{encoding,video})
|
||||
|
@@ -163,9 +163,6 @@ Requires the presence of the libopus headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libopus}.
|
||||
|
||||
An FFmpeg native decoder for Opus exists, so users can decode Opus
|
||||
without this library.
|
||||
|
||||
@c man end AUDIO DECODERS
|
||||
|
||||
@chapter Subtitles Decoders
|
||||
|
@@ -174,40 +174,6 @@ See @url{http://quvi.sourceforge.net/} for more information.
|
||||
FFmpeg needs to be built with @code{--enable-libquvi} for this demuxer to be
|
||||
enabled.
|
||||
|
||||
@section gif
|
||||
|
||||
Animated GIF demuxer.
|
||||
|
||||
It accepts the following options:
|
||||
|
||||
@table @option
|
||||
@item min_delay
|
||||
Set the minimum valid delay between frames in hundredths of seconds.
|
||||
Range is 0 to 6000. Default value is 2.
|
||||
|
||||
@item default_delay
|
||||
Set the default delay between frames in hundredths of seconds.
|
||||
Range is 0 to 6000. Default value is 10.
|
||||
|
||||
@item ignore_loop
|
||||
GIF files can contain information to loop a certain number of times (or
|
||||
infinitely). If @option{ignore_loop} is set to 1, then the loop setting
|
||||
from the input will be ignored and looping will not occur. If set to 0,
|
||||
then looping will occur and will cycle the number of times according to
|
||||
the GIF. Default value is 1.
|
||||
@end table
|
||||
|
||||
For example, with the overlay filter, place an infinitely looping GIF
|
||||
over another video:
|
||||
@example
|
||||
ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
|
||||
@end example
|
||||
|
||||
Note that in the above example the shortest option for overlay filter is
|
||||
used to end the output video at the length of the shortest input file,
|
||||
which in this case is @file{input.mp4} as the GIF in this example loops
|
||||
infinitely.
|
||||
|
||||
@section image2
|
||||
|
||||
Image file demuxer.
|
||||
@@ -339,23 +305,6 @@ ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section mov/mp4/3gp/Quicktme
|
||||
|
||||
Quicktime / MP4 demuxer.
|
||||
|
||||
This demuxer accepts the following options:
|
||||
@table @option
|
||||
@item enable_drefs
|
||||
Enable loading of external tracks, disabled by default.
|
||||
Enabling this can theoretically leak information in some use cases.
|
||||
|
||||
@item use_absolute_path
|
||||
Allows loading of external tracks via absolute paths, disabled by default.
|
||||
Enabling this poses a security risk. It should only be enabled if the source
|
||||
is known to be non malicious.
|
||||
|
||||
@end table
|
||||
|
||||
@section mpegts
|
||||
|
||||
MPEG-2 transport stream demuxer.
|
||||
|
@@ -323,12 +323,9 @@ Always fill out the commit log message. Describe in a few lines what you
|
||||
changed and why. You can refer to mailing list postings if you fix a
|
||||
particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
|
||||
Recommended format:
|
||||
|
||||
@example
|
||||
area changed: Short 1 line description
|
||||
|
||||
details describing what and why and giving references.
|
||||
@end example
|
||||
|
||||
@item
|
||||
Make sure the author of the commit is set correctly. (see git commit --author)
|
||||
|
@@ -1032,7 +1032,7 @@ configuration. You need to explicitly configure the build with
|
||||
|
||||
@subsection Option Mapping
|
||||
|
||||
Most libopus options are modelled after the @command{opusenc} utility from
|
||||
Most libopus options are modeled after the @command{opusenc} utility from
|
||||
opus-tools. The following is an option mapping chart describing options
|
||||
supported by the libopus wrapper, and their @command{opusenc}-equivalent
|
||||
in parentheses.
|
||||
@@ -1330,7 +1330,7 @@ ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
|
||||
|
||||
@section libvpx
|
||||
|
||||
VP8/VP9 format supported through libvpx.
|
||||
VP8 format supported through libvpx.
|
||||
|
||||
Requires the presence of the libvpx headers and library during configuration.
|
||||
You need to explicitly configure the build with @code{--enable-libvpx}.
|
||||
@@ -1442,9 +1442,6 @@ g_lag_in_frames
|
||||
@item vp8flags error_resilient
|
||||
g_error_resilient
|
||||
|
||||
@item aq_mode
|
||||
@code{VP9E_SET_AQ_MODE}
|
||||
|
||||
@end table
|
||||
|
||||
For more information about libvpx see:
|
||||
|
@@ -14,7 +14,6 @@ LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
|
||||
EXAMPLES= avio_reading \
|
||||
decoding_encoding \
|
||||
demuxing_decoding \
|
||||
extract_mvs \
|
||||
filtering_video \
|
||||
filtering_audio \
|
||||
metadata \
|
||||
@@ -29,7 +28,6 @@ OBJS=$(addsuffix .o,$(EXAMPLES))
|
||||
|
||||
# the following examples make explicit use of the math library
|
||||
avcodec: LDLIBS += -lm
|
||||
decoding_encoding: LDLIBS += -lm
|
||||
muxing: LDLIBS += -lm
|
||||
resampling_audio: LDLIBS += -lm
|
||||
|
||||
|
@@ -1,185 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Stefano Sabatini
|
||||
* Copyright (c) 2014 Clément Bœsch
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <libavutil/motion_vector.h>
|
||||
#include <libavformat/avformat.h>
|
||||
|
||||
static AVFormatContext *fmt_ctx = NULL;
|
||||
static AVCodecContext *video_dec_ctx = NULL;
|
||||
static AVStream *video_stream = NULL;
|
||||
static const char *src_filename = NULL;
|
||||
|
||||
static int video_stream_idx = -1;
|
||||
static AVFrame *frame = NULL;
|
||||
static AVPacket pkt;
|
||||
static int video_frame_count = 0;
|
||||
|
||||
static int decode_packet(int *got_frame, int cached)
|
||||
{
|
||||
int decoded = pkt.size;
|
||||
|
||||
*got_frame = 0;
|
||||
|
||||
if (pkt.stream_index == video_stream_idx) {
|
||||
int ret = avcodec_decode_video2(video_dec_ctx, frame, got_frame, &pkt);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (*got_frame) {
|
||||
int i;
|
||||
AVFrameSideData *sd;
|
||||
|
||||
video_frame_count++;
|
||||
sd = av_frame_get_side_data(frame, AV_FRAME_DATA_MOTION_VECTORS);
|
||||
if (sd) {
|
||||
const AVMotionVector *mvs = (const AVMotionVector *)sd->data;
|
||||
for (i = 0; i < sd->size / sizeof(*mvs); i++) {
|
||||
const AVMotionVector *mv = &mvs[i];
|
||||
printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64"\n",
|
||||
video_frame_count, mv->source,
|
||||
mv->w, mv->h, mv->src_x, mv->src_y,
|
||||
mv->dst_x, mv->dst_y, mv->flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return decoded;
|
||||
}
|
||||
|
||||
static int open_codec_context(int *stream_idx,
|
||||
AVFormatContext *fmt_ctx, enum AVMediaType type)
|
||||
{
|
||||
int ret;
|
||||
AVStream *st;
|
||||
AVCodecContext *dec_ctx = NULL;
|
||||
AVCodec *dec = NULL;
|
||||
AVDictionary *opts = NULL;
|
||||
|
||||
ret = av_find_best_stream(fmt_ctx, type, -1, -1, NULL, 0);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not find %s stream in input file '%s'\n",
|
||||
av_get_media_type_string(type), src_filename);
|
||||
return ret;
|
||||
} else {
|
||||
*stream_idx = ret;
|
||||
st = fmt_ctx->streams[*stream_idx];
|
||||
|
||||
/* find decoder for the stream */
|
||||
dec_ctx = st->codec;
|
||||
dec = avcodec_find_decoder(dec_ctx->codec_id);
|
||||
if (!dec) {
|
||||
fprintf(stderr, "Failed to find %s codec\n",
|
||||
av_get_media_type_string(type));
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
/* Init the video decoder */
|
||||
av_dict_set(&opts, "flags2", "+export_mvs", 0);
|
||||
if ((ret = avcodec_open2(dec_ctx, dec, &opts)) < 0) {
|
||||
fprintf(stderr, "Failed to open %s codec\n",
|
||||
av_get_media_type_string(type));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ret = 0, got_frame;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s <video>\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
src_filename = argv[1];
|
||||
|
||||
av_register_all();
|
||||
|
||||
if (avformat_open_input(&fmt_ctx, src_filename, NULL, NULL) < 0) {
|
||||
fprintf(stderr, "Could not open source file %s\n", src_filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (avformat_find_stream_info(fmt_ctx, NULL) < 0) {
|
||||
fprintf(stderr, "Could not find stream information\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (open_codec_context(&video_stream_idx, fmt_ctx, AVMEDIA_TYPE_VIDEO) >= 0) {
|
||||
video_stream = fmt_ctx->streams[video_stream_idx];
|
||||
video_dec_ctx = video_stream->codec;
|
||||
}
|
||||
|
||||
av_dump_format(fmt_ctx, 0, src_filename, 0);
|
||||
|
||||
if (!video_stream) {
|
||||
fprintf(stderr, "Could not find video stream in the input, aborting\n");
|
||||
ret = 1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
frame = av_frame_alloc();
|
||||
if (!frame) {
|
||||
fprintf(stderr, "Could not allocate frame\n");
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto end;
|
||||
}
|
||||
|
||||
printf("framenum,source,blockw,blockh,srcx,srcy,dstx,dsty,flags\n");
|
||||
|
||||
/* initialize packet, set data to NULL, let the demuxer fill it */
|
||||
av_init_packet(&pkt);
|
||||
pkt.data = NULL;
|
||||
pkt.size = 0;
|
||||
|
||||
/* read frames from the file */
|
||||
while (av_read_frame(fmt_ctx, &pkt) >= 0) {
|
||||
AVPacket orig_pkt = pkt;
|
||||
do {
|
||||
ret = decode_packet(&got_frame, 0);
|
||||
if (ret < 0)
|
||||
break;
|
||||
pkt.data += ret;
|
||||
pkt.size -= ret;
|
||||
} while (pkt.size > 0);
|
||||
av_free_packet(&orig_pkt);
|
||||
}
|
||||
|
||||
/* flush cached frames */
|
||||
pkt.data = NULL;
|
||||
pkt.size = 0;
|
||||
do {
|
||||
decode_packet(&got_frame, 1);
|
||||
} while (got_frame);
|
||||
|
||||
end:
|
||||
avcodec_close(video_dec_ctx);
|
||||
avformat_close_input(&fmt_ctx);
|
||||
av_frame_free(&frame);
|
||||
return ret < 0;
|
||||
}
|
@@ -45,7 +45,6 @@
|
||||
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/md5.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
|
||||
|
@@ -55,7 +55,6 @@ typedef struct OutputStream {
|
||||
|
||||
/* pts of the next frame that will be generated */
|
||||
int64_t next_pts;
|
||||
int samples_count;
|
||||
|
||||
AVFrame *frame;
|
||||
AVFrame *tmp_frame;
|
||||
@@ -63,7 +62,6 @@ typedef struct OutputStream {
|
||||
float t, tincr, tincr2;
|
||||
|
||||
struct SwsContext *sws_ctx;
|
||||
struct SwrContext *swr_ctx;
|
||||
} OutputStream;
|
||||
|
||||
static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt)
|
||||
@@ -94,7 +92,6 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
|
||||
enum AVCodecID codec_id)
|
||||
{
|
||||
AVCodecContext *c;
|
||||
int i;
|
||||
|
||||
/* find the encoder */
|
||||
*codec = avcodec_find_encoder(codec_id);
|
||||
@@ -118,24 +115,8 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
|
||||
(*codec)->sample_fmts[0] : AV_SAMPLE_FMT_FLTP;
|
||||
c->bit_rate = 64000;
|
||||
c->sample_rate = 44100;
|
||||
if ((*codec)->supported_samplerates) {
|
||||
c->sample_rate = (*codec)->supported_samplerates[0];
|
||||
for (i = 0; (*codec)->supported_samplerates[i]; i++) {
|
||||
if ((*codec)->supported_samplerates[i] == 44100)
|
||||
c->sample_rate = 44100;
|
||||
}
|
||||
}
|
||||
c->channels = av_get_channel_layout_nb_channels(c->channel_layout);
|
||||
c->channels = 2;
|
||||
c->channel_layout = AV_CH_LAYOUT_STEREO;
|
||||
if ((*codec)->channel_layouts) {
|
||||
c->channel_layout = (*codec)->channel_layouts[0];
|
||||
for (i = 0; (*codec)->channel_layouts[i]; i++) {
|
||||
if ((*codec)->channel_layouts[i] == AV_CH_LAYOUT_STEREO)
|
||||
c->channel_layout = AV_CH_LAYOUT_STEREO;
|
||||
}
|
||||
}
|
||||
c->channels = av_get_channel_layout_nb_channels(c->channel_layout);
|
||||
ost->st->time_base = (AVRational){ 1, c->sample_rate };
|
||||
break;
|
||||
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
@@ -149,9 +130,8 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
|
||||
* of which frame timestamps are represented. For fixed-fps content,
|
||||
* timebase should be 1/framerate and timestamp increments should be
|
||||
* identical to 1. */
|
||||
ost->st->time_base = (AVRational){ 1, STREAM_FRAME_RATE };
|
||||
c->time_base = ost->st->time_base;
|
||||
|
||||
c->time_base.den = STREAM_FRAME_RATE;
|
||||
c->time_base.num = 1;
|
||||
c->gop_size = 12; /* emit one intra frame every twelve frames at most */
|
||||
c->pix_fmt = STREAM_PIX_FMT;
|
||||
if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
|
||||
@@ -178,47 +158,19 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
|
||||
/**************************************************************/
|
||||
/* audio output */
|
||||
|
||||
static AVFrame *alloc_audio_frame(enum AVSampleFormat sample_fmt,
|
||||
uint64_t channel_layout,
|
||||
int sample_rate, int nb_samples)
|
||||
{
|
||||
AVFrame *frame = av_frame_alloc();
|
||||
int ret;
|
||||
int samples_count;
|
||||
|
||||
if (!frame) {
|
||||
fprintf(stderr, "Error allocating an audio frame\n");
|
||||
exit(1);
|
||||
}
|
||||
struct SwrContext *swr_ctx = NULL;
|
||||
|
||||
frame->format = sample_fmt;
|
||||
frame->channel_layout = channel_layout;
|
||||
frame->sample_rate = sample_rate;
|
||||
frame->nb_samples = nb_samples;
|
||||
|
||||
if (nb_samples) {
|
||||
ret = av_frame_get_buffer(frame, 0);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error allocating an audio buffer\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg)
|
||||
static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost)
|
||||
{
|
||||
AVCodecContext *c;
|
||||
int nb_samples;
|
||||
int ret;
|
||||
AVDictionary *opt = NULL;
|
||||
|
||||
c = ost->st->codec;
|
||||
|
||||
/* open it */
|
||||
av_dict_copy(&opt, opt_arg, 0);
|
||||
ret = avcodec_open2(c, codec, &opt);
|
||||
av_dict_free(&opt);
|
||||
ret = avcodec_open2(c, codec, NULL);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not open audio codec: %s\n", av_err2str(ret));
|
||||
exit(1);
|
||||
@@ -230,52 +182,84 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A
|
||||
/* increment frequency by 110 Hz per second */
|
||||
ost->tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate;
|
||||
|
||||
if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
|
||||
nb_samples = 10000;
|
||||
else
|
||||
nb_samples = c->frame_size;
|
||||
ost->frame = av_frame_alloc();
|
||||
if (!ost->frame)
|
||||
exit(1);
|
||||
|
||||
ost->frame = alloc_audio_frame(c->sample_fmt, c->channel_layout,
|
||||
c->sample_rate, nb_samples);
|
||||
ost->tmp_frame = alloc_audio_frame(AV_SAMPLE_FMT_S16, c->channel_layout,
|
||||
c->sample_rate, nb_samples);
|
||||
ost->frame->sample_rate = c->sample_rate;
|
||||
ost->frame->format = AV_SAMPLE_FMT_S16;
|
||||
ost->frame->channel_layout = c->channel_layout;
|
||||
|
||||
if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
|
||||
ost->frame->nb_samples = 10000;
|
||||
else
|
||||
ost->frame->nb_samples = c->frame_size;
|
||||
|
||||
ost->tmp_frame = av_frame_alloc();
|
||||
if (!ost->frame)
|
||||
exit(1);
|
||||
|
||||
ost->tmp_frame->sample_rate = c->sample_rate;
|
||||
ost->tmp_frame->format = c->sample_fmt;
|
||||
ost->tmp_frame->channel_layout = c->channel_layout;
|
||||
ost->tmp_frame->nb_samples = ost->frame->nb_samples;
|
||||
|
||||
/* create resampler context */
|
||||
ost->swr_ctx = swr_alloc();
|
||||
if (!ost->swr_ctx) {
|
||||
if (c->sample_fmt != AV_SAMPLE_FMT_S16) {
|
||||
swr_ctx = swr_alloc();
|
||||
if (!swr_ctx) {
|
||||
fprintf(stderr, "Could not allocate resampler context\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* set options */
|
||||
av_opt_set_int (ost->swr_ctx, "in_channel_count", c->channels, 0);
|
||||
av_opt_set_int (ost->swr_ctx, "in_sample_rate", c->sample_rate, 0);
|
||||
av_opt_set_sample_fmt(ost->swr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0);
|
||||
av_opt_set_int (ost->swr_ctx, "out_channel_count", c->channels, 0);
|
||||
av_opt_set_int (ost->swr_ctx, "out_sample_rate", c->sample_rate, 0);
|
||||
av_opt_set_sample_fmt(ost->swr_ctx, "out_sample_fmt", c->sample_fmt, 0);
|
||||
av_opt_set_int (swr_ctx, "in_channel_count", c->channels, 0);
|
||||
av_opt_set_int (swr_ctx, "in_sample_rate", c->sample_rate, 0);
|
||||
av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0);
|
||||
av_opt_set_int (swr_ctx, "out_channel_count", c->channels, 0);
|
||||
av_opt_set_int (swr_ctx, "out_sample_rate", c->sample_rate, 0);
|
||||
av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", c->sample_fmt, 0);
|
||||
|
||||
/* initialize the resampling context */
|
||||
if ((ret = swr_init(ost->swr_ctx)) < 0) {
|
||||
if ((ret = swr_init(swr_ctx)) < 0) {
|
||||
fprintf(stderr, "Failed to initialize the resampling context\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
ret = av_frame_get_buffer(ost->frame, 0);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not allocate an audio frame.\n");
|
||||
exit(1);
|
||||
}
|
||||
ret = av_frame_get_buffer(ost->tmp_frame, 0);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not allocate an audio frame.\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Prepare a 16 bit dummy audio frame of 'frame_size' samples and
|
||||
* 'nb_channels' channels. */
|
||||
static AVFrame *get_audio_frame(OutputStream *ost)
|
||||
{
|
||||
AVFrame *frame = ost->tmp_frame;
|
||||
int j, i, v;
|
||||
int16_t *q = (int16_t*)frame->data[0];
|
||||
int j, i, v, ret;
|
||||
int16_t *q = (int16_t*)ost->frame->data[0];
|
||||
|
||||
/* check if we want to generate more frames */
|
||||
if (av_compare_ts(ost->next_pts, ost->st->codec->time_base,
|
||||
STREAM_DURATION, (AVRational){ 1, 1 }) >= 0)
|
||||
return NULL;
|
||||
|
||||
for (j = 0; j <frame->nb_samples; j++) {
|
||||
/* when we pass a frame to the encoder, it may keep a reference to it
|
||||
* internally;
|
||||
* make sure we do not overwrite it here
|
||||
*/
|
||||
ret = av_frame_make_writable(ost->frame);
|
||||
if (ret < 0)
|
||||
exit(1);
|
||||
|
||||
for (j = 0; j < ost->frame->nb_samples; j++) {
|
||||
v = (int)(sin(ost->t) * 10000);
|
||||
for (i = 0; i < ost->st->codec->channels; i++)
|
||||
*q++ = v;
|
||||
@@ -283,10 +267,10 @@ static AVFrame *get_audio_frame(OutputStream *ost)
|
||||
ost->tincr += ost->tincr2;
|
||||
}
|
||||
|
||||
frame->pts = ost->next_pts;
|
||||
ost->next_pts += frame->nb_samples;
|
||||
ost->frame->pts = ost->next_pts;
|
||||
ost->next_pts += ost->frame->nb_samples;
|
||||
|
||||
return frame;
|
||||
return ost->frame;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -309,31 +293,27 @@ static int write_audio_frame(AVFormatContext *oc, OutputStream *ost)
|
||||
|
||||
if (frame) {
|
||||
/* convert samples from native format to destination codec format, using the resampler */
|
||||
if (swr_ctx) {
|
||||
/* compute destination number of samples */
|
||||
dst_nb_samples = av_rescale_rnd(swr_get_delay(ost->swr_ctx, c->sample_rate) + frame->nb_samples,
|
||||
dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, c->sample_rate) + frame->nb_samples,
|
||||
c->sample_rate, c->sample_rate, AV_ROUND_UP);
|
||||
av_assert0(dst_nb_samples == frame->nb_samples);
|
||||
|
||||
/* when we pass a frame to the encoder, it may keep a reference to it
|
||||
* internally;
|
||||
* make sure we do not overwrite it here
|
||||
*/
|
||||
ret = av_frame_make_writable(ost->frame);
|
||||
if (ret < 0)
|
||||
exit(1);
|
||||
|
||||
/* convert to destination format */
|
||||
ret = swr_convert(ost->swr_ctx,
|
||||
ost->frame->data, dst_nb_samples,
|
||||
ret = swr_convert(swr_ctx,
|
||||
ost->tmp_frame->data, dst_nb_samples,
|
||||
(const uint8_t **)frame->data, frame->nb_samples);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error while converting\n");
|
||||
exit(1);
|
||||
}
|
||||
frame = ost->frame;
|
||||
frame = ost->tmp_frame;
|
||||
} else {
|
||||
dst_nb_samples = frame->nb_samples;
|
||||
}
|
||||
|
||||
frame->pts = av_rescale_q(ost->samples_count, (AVRational){1, c->sample_rate}, c->time_base);
|
||||
ost->samples_count += dst_nb_samples;
|
||||
frame->pts = av_rescale_q(samples_count, (AVRational){1, c->sample_rate}, c->time_base);
|
||||
samples_count += dst_nb_samples;
|
||||
}
|
||||
|
||||
ret = avcodec_encode_audio2(c, &pkt, frame, &got_packet);
|
||||
@@ -380,17 +360,13 @@ static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height)
|
||||
return picture;
|
||||
}
|
||||
|
||||
static void open_video(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg)
|
||||
static void open_video(AVFormatContext *oc, AVCodec *codec, OutputStream *ost)
|
||||
{
|
||||
int ret;
|
||||
AVCodecContext *c = ost->st->codec;
|
||||
AVDictionary *opt = NULL;
|
||||
|
||||
av_dict_copy(&opt, opt_arg, 0);
|
||||
|
||||
/* open the codec */
|
||||
ret = avcodec_open2(c, codec, &opt);
|
||||
av_dict_free(&opt);
|
||||
ret = avcodec_open2(c, codec, NULL);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Could not open video codec: %s\n", av_err2str(ret));
|
||||
exit(1);
|
||||
@@ -547,7 +523,6 @@ static void close_stream(AVFormatContext *oc, OutputStream *ost)
|
||||
av_frame_free(&ost->frame);
|
||||
av_frame_free(&ost->tmp_frame);
|
||||
sws_freeContext(ost->sws_ctx);
|
||||
swr_free(&ost->swr_ctx);
|
||||
}
|
||||
|
||||
/**************************************************************/
|
||||
@@ -563,12 +538,11 @@ int main(int argc, char **argv)
|
||||
int ret;
|
||||
int have_video = 0, have_audio = 0;
|
||||
int encode_video = 0, encode_audio = 0;
|
||||
AVDictionary *opt = NULL;
|
||||
|
||||
/* Initialize libavcodec, and register all codecs and formats. */
|
||||
av_register_all();
|
||||
|
||||
if (argc < 2) {
|
||||
if (argc != 2) {
|
||||
printf("usage: %s output_file\n"
|
||||
"API example program to output a media file with libavformat.\n"
|
||||
"This program generates a synthetic audio and video stream, encodes and\n"
|
||||
@@ -580,9 +554,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
filename = argv[1];
|
||||
if (argc > 3 && !strcmp(argv[2], "-flags")) {
|
||||
av_dict_set(&opt, argv[2]+1, argv[3], 0);
|
||||
}
|
||||
|
||||
/* allocate the output media context */
|
||||
avformat_alloc_output_context2(&oc, NULL, NULL, filename);
|
||||
@@ -611,10 +582,10 @@ int main(int argc, char **argv)
|
||||
/* Now that all the parameters are set, we can open the audio and
|
||||
* video codecs and allocate the necessary encode buffers. */
|
||||
if (have_video)
|
||||
open_video(oc, video_codec, &video_st, opt);
|
||||
open_video(oc, video_codec, &video_st);
|
||||
|
||||
if (have_audio)
|
||||
open_audio(oc, audio_codec, &audio_st, opt);
|
||||
open_audio(oc, audio_codec, &audio_st);
|
||||
|
||||
av_dump_format(oc, 0, filename, 1);
|
||||
|
||||
@@ -629,7 +600,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* Write the stream header, if any. */
|
||||
ret = avformat_write_header(oc, &opt);
|
||||
ret = avformat_write_header(oc, NULL);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error occurred when opening output file: %s\n",
|
||||
av_err2str(ret));
|
||||
|
@@ -199,7 +199,8 @@ int main(int argc, char **argv)
|
||||
fmt, dst_ch_layout, dst_nb_channels, dst_rate, dst_filename);
|
||||
|
||||
end:
|
||||
fclose(dst_file);
|
||||
if (dst_file)
|
||||
fclose(dst_file);
|
||||
|
||||
if (src_data)
|
||||
av_freep(&src_data[0]);
|
||||
|
@@ -132,7 +132,8 @@ int main(int argc, char **argv)
|
||||
av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h, dst_filename);
|
||||
|
||||
end:
|
||||
fclose(dst_file);
|
||||
if (dst_file)
|
||||
fclose(dst_file);
|
||||
av_freep(&src_data[0]);
|
||||
av_freep(&dst_data[0]);
|
||||
sws_freeContext(sws_ctx);
|
||||
|
@@ -52,7 +52,7 @@
|
||||
* @param error Error code to be converted
|
||||
* @return Corresponding error text (not thread-safe)
|
||||
*/
|
||||
static const char *get_error_text(const int error)
|
||||
static char *const get_error_text(const int error)
|
||||
{
|
||||
static char error_buffer[255];
|
||||
av_strerror(error, error_buffer, sizeof(error_buffer));
|
||||
|
@@ -116,10 +116,6 @@ static int open_output_file(const char *filename)
|
||||
|| dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
/* in this example, we choose transcoding to same codec */
|
||||
encoder = avcodec_find_encoder(dec_ctx->codec_id);
|
||||
if (!encoder) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Neccessary encoder not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/* In this example, we transcode to same properties (picture size,
|
||||
* sample rate etc.). These properties can be changed for output
|
||||
|
@@ -298,7 +298,7 @@ FFmpeg has a @url{http://ffmpeg.org/ffmpeg-protocols.html#concat,
|
||||
@code{concat}} protocol designed specifically for that, with examples in the
|
||||
documentation.
|
||||
|
||||
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow one to concatenate
|
||||
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to concatenate
|
||||
video by merely concatenating the files containing them.
|
||||
|
||||
Hence you may concatenate your multimedia files by first transcoding them to
|
||||
|
@@ -339,7 +339,7 @@ ffmpeg -i in.avi -metadata title="my title" out.flv
|
||||
|
||||
To set the language of the first audio stream:
|
||||
@example
|
||||
ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
|
||||
ffmpeg -i INPUT -metadata:s:a:1 language=eng OUTPUT
|
||||
@end example
|
||||
|
||||
@item -target @var{type} (@emph{output})
|
||||
@@ -473,9 +473,6 @@ Set frame rate (Hz value, fraction or abbreviation).
|
||||
|
||||
As an input option, ignore any timestamps stored in the file and instead
|
||||
generate timestamps assuming constant frame rate @var{fps}.
|
||||
This is not the same as the @option{-framerate} option used for some input formats
|
||||
like image2 or v4l2 (it used to be the same in older versions of FFmpeg).
|
||||
If in doubt use @option{-framerate} instead of the input option @option{-r}.
|
||||
|
||||
As an output option, duplicate or drop input frames to achieve constant output
|
||||
frame rate @var{fps}.
|
||||
@@ -824,11 +821,6 @@ To map all the streams except the second audio, use negative mappings
|
||||
ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
|
||||
@end example
|
||||
|
||||
To pick the English audio stream:
|
||||
@example
|
||||
ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
|
||||
@end example
|
||||
|
||||
Note that using this option disables the default mappings for this output file.
|
||||
|
||||
@item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][:@var{output_file_id}.@var{stream_specifier}]
|
||||
@@ -1458,11 +1450,11 @@ ffmpeg -f image2 -pattern_type glob -i 'foo-*.jpeg' -r 12 -s WxH foo.avi
|
||||
You can put many streams of the same type in the output:
|
||||
|
||||
@example
|
||||
ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
|
||||
ffmpeg -i test1.avi -i test2.avi -map 0:3 -map 0:2 -map 0:1 -map 0:0 -c copy test12.nut
|
||||
@end example
|
||||
|
||||
The resulting output file @file{test12.nut} will contain the first four streams
|
||||
from the input files in reverse order.
|
||||
The resulting output file @file{test12.avi} will contain first four streams from
|
||||
the input file in reverse order.
|
||||
|
||||
@item
|
||||
To force CBR video output:
|
||||
|
@@ -119,10 +119,6 @@ Show payload data, as a hexadecimal and ASCII dump. Coupled with
|
||||
|
||||
The dump is printed as the "data" field. It may contain newlines.
|
||||
|
||||
@item -show_data_hash @var{algorithm}
|
||||
Show a hash of payload data, for packets with @option{-show_packets} and for
|
||||
codec extradata with @option{-show_streams}.
|
||||
|
||||
@item -show_error
|
||||
Show information about the error found when trying to probe the input.
|
||||
|
||||
@@ -184,7 +180,7 @@ format : stream=codec_type
|
||||
|
||||
To show all the tags in the stream and format sections:
|
||||
@example
|
||||
stream_tags : format_tags
|
||||
format_tags : format_tags
|
||||
@end example
|
||||
|
||||
To show only the @code{title} tag (if available) in the stream
|
||||
|
@@ -50,13 +50,11 @@
|
||||
<xsd:attribute name="pos" type="xsd:long" />
|
||||
<xsd:attribute name="flags" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="data" type="xsd:string" />
|
||||
<xsd:attribute name="data_hash" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="frameType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="side_data_list" type="ffprobe:frameSideDataListType" minOccurs="0" maxOccurs="1" />
|
||||
</xsd:sequence>
|
||||
|
||||
<xsd:attribute name="media_type" type="xsd:string" use="required"/>
|
||||
@@ -93,16 +91,6 @@
|
||||
<xsd:attribute name="repeat_pict" type="xsd:int" />
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="frameSideDataListType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="side_data" type="ffprobe:frameSideDataType" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
<xsd:complexType name="frameSideDataType">
|
||||
<xsd:attribute name="side_data_type" type="xsd:string"/>
|
||||
<xsd:attribute name="side_data_size" type="xsd:int" />
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="subtitleType">
|
||||
<xsd:attribute name="media_type" type="xsd:string" fixed="subtitle" use="required"/>
|
||||
<xsd:attribute name="pts" type="xsd:long" />
|
||||
@@ -154,7 +142,6 @@
|
||||
<xsd:attribute name="codec_tag" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="codec_tag_string" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="extradata" type="xsd:string" />
|
||||
<xsd:attribute name="extradata_hash" type="xsd:string" />
|
||||
|
||||
<!-- video attributes -->
|
||||
<xsd:attribute name="width" type="xsd:int"/>
|
||||
@@ -185,7 +172,6 @@
|
||||
<xsd:attribute name="duration" type="xsd:float"/>
|
||||
<xsd:attribute name="bit_rate" type="xsd:int"/>
|
||||
<xsd:attribute name="max_bit_rate" type="xsd:int"/>
|
||||
<xsd:attribute name="bits_per_raw_sample" type="xsd:int"/>
|
||||
<xsd:attribute name="nb_frames" type="xsd:int"/>
|
||||
<xsd:attribute name="nb_read_frames" type="xsd:int"/>
|
||||
<xsd:attribute name="nb_read_packets" type="xsd:int"/>
|
||||
|
@@ -1,11 +1,11 @@
|
||||
# Port on which the server is listening. You must select a different
|
||||
# port from your standard HTTP web server if it is running on the same
|
||||
# computer.
|
||||
HTTPPort 8090
|
||||
Port 8090
|
||||
|
||||
# Address on which the server is bound. Only useful if you have
|
||||
# several network interfaces.
|
||||
HTTPBindAddress 0.0.0.0
|
||||
BindAddress 0.0.0.0
|
||||
|
||||
# Number of simultaneous HTTP connections that can be handled. It has
|
||||
# to be defined *before* the MaxClients parameter, since it defines the
|
||||
|
@@ -66,12 +66,12 @@ http://@var{ffserver_ip_address}:@var{http_port}/@var{feed_name}
|
||||
|
||||
where @var{ffserver_ip_address} is the IP address of the machine where
|
||||
@command{ffserver} is installed, @var{http_port} is the port number of
|
||||
the HTTP server (configured through the @option{HTTPPort} option), and
|
||||
the HTTP server (configured through the @option{Port} option), and
|
||||
@var{feed_name} is the name of the corresponding feed defined in the
|
||||
configuration file.
|
||||
|
||||
Each feed is associated to a file which is stored on disk. This stored
|
||||
file is used to send pre-recorded data to a player as fast as
|
||||
file is used to allow to send pre-recorded data to a player as fast as
|
||||
possible when new content is added in real-time to the stream.
|
||||
|
||||
A "live-stream" or "stream" is a resource published by
|
||||
@@ -101,7 +101,7 @@ http://@var{ffserver_ip_address}:@var{rtsp_port}/@var{stream_name}[@var{options}
|
||||
the configuration file. @var{options} is a list of options specified
|
||||
after the URL which affects how the stream is served by
|
||||
@command{ffserver}. @var{http_port} and @var{rtsp_port} are the HTTP
|
||||
and RTSP ports configured with the options @var{HTTPPort} and
|
||||
and RTSP ports configured with the options @var{Port} and
|
||||
@var{RTSPPort} respectively.
|
||||
|
||||
In case the stream is associated to a feed, the encoding parameters
|
||||
@@ -203,9 +203,11 @@ WARNING: trying to stream test1.mpg doesn't work with WMP as it tries to
|
||||
transfer the entire file before starting to play.
|
||||
The same is true of AVI files.
|
||||
|
||||
You should edit the @file{ffserver.conf} file to suit your needs (in
|
||||
terms of frame rates etc). Then install @command{ffserver} and
|
||||
@command{ffmpeg}, write a script to start them up, and off you go.
|
||||
@section What happens next?
|
||||
|
||||
You should edit the ffserver.conf file to suit your needs (in terms of
|
||||
frame rates etc). Then install ffserver and ffmpeg, write a script to start
|
||||
them up, and off you go.
|
||||
|
||||
@section What else can it do?
|
||||
|
||||
@@ -352,29 +354,20 @@ allow everybody else.
|
||||
|
||||
@section Global options
|
||||
@table @option
|
||||
@item HTTPPort @var{port_number}
|
||||
@item Port @var{port_number}
|
||||
@item RTSPPort @var{port_number}
|
||||
|
||||
@var{HTTPPort} sets the HTTP server listening TCP port number,
|
||||
@var{RTSPPort} sets the RTSP server listening TCP port number.
|
||||
|
||||
@var{Port} is the equivalent of @var{HTTPPort} and is deprecated.
|
||||
|
||||
You must select a different port from your standard HTTP web server if
|
||||
it is running on the same computer.
|
||||
Set TCP port number on which the HTTP/RTSP server is listening. You
|
||||
must select a different port from your standard HTTP web server if it
|
||||
is running on the same computer.
|
||||
|
||||
If not specified, no corresponding server will be created.
|
||||
|
||||
@item HTTPBindAddress @var{ip_address}
|
||||
@item BindAddress @var{ip_address}
|
||||
@item RTSPBindAddress @var{ip_address}
|
||||
Set address on which the HTTP/RTSP server is bound. Only useful if you
|
||||
have several network interfaces.
|
||||
|
||||
@var{BindAddress} is the equivalent of @var{HTTPBindAddress} and is
|
||||
deprecated.
|
||||
|
||||
@item MaxHTTPConnections @var{n}
|
||||
Set number of simultaneous HTTP connections that can be handled. It
|
||||
has to be defined @emph{before} the @option{MaxClients} parameter,
|
||||
|
@@ -3,7 +3,7 @@ representing a number as input, which may be followed by one of the SI
|
||||
unit prefixes, for example: 'K', 'M', or 'G'.
|
||||
|
||||
If 'i' is appended to the SI unit prefix, the complete prefix will be
|
||||
interpreted as a unit prefix for binary multiples, which are based on
|
||||
interpreted as a unit prefix for binary multiplies, which are based on
|
||||
powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit
|
||||
prefix multiplies the value by 8. This allows using, for example:
|
||||
'KB', 'MiB', 'G' and 'B' as number suffixes.
|
||||
@@ -46,13 +46,6 @@ in the program with the id @var{program_id}. Otherwise, it matches all streams i
|
||||
program.
|
||||
@item #@var{stream_id} or i:@var{stream_id}
|
||||
Match the stream by stream id (e.g. PID in MPEG-TS container).
|
||||
@item m:@var{key}[:@var{value}]
|
||||
Matches streams with the metadata tag @var{key} having the specified value. If
|
||||
@var{value} is not given, matches streams that contain the given tag with any
|
||||
value.
|
||||
|
||||
Note that in @command{ffmpeg}, matching by metadata will only work properly for
|
||||
input files.
|
||||
@end table
|
||||
|
||||
@section Generic options
|
||||
@@ -234,14 +227,10 @@ Possible flags for this option are:
|
||||
@item sse4.1
|
||||
@item sse4.2
|
||||
@item avx
|
||||
@item avx2
|
||||
@item xop
|
||||
@item fma3
|
||||
@item fma4
|
||||
@item 3dnow
|
||||
@item 3dnowext
|
||||
@item bmi1
|
||||
@item bmi2
|
||||
@item cmov
|
||||
@end table
|
||||
@item ARM
|
||||
@@ -252,13 +241,6 @@ Possible flags for this option are:
|
||||
@item vfp
|
||||
@item vfpv3
|
||||
@item neon
|
||||
@item setend
|
||||
@end table
|
||||
@item AArch64
|
||||
@table @samp
|
||||
@item armv8
|
||||
@item vfp
|
||||
@item neon
|
||||
@end table
|
||||
@item PowerPC
|
||||
@table @samp
|
||||
|
433
doc/filters.texi
433
doc/filters.texi
@@ -491,7 +491,7 @@ aeval=val(ch)/2:c=same
|
||||
@item
|
||||
Invert phase of the second channel:
|
||||
@example
|
||||
aeval=val(0)|-val(1)
|
||||
eval=val(0)|-val(1)
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@@ -517,21 +517,27 @@ volume as the input audio, at the end of the fade-out transition
|
||||
the output audio will be silence. Default is 44100.
|
||||
|
||||
@item start_time, st
|
||||
Specify the start time of the fade effect. Default is 0.
|
||||
The value must be specified as a time duration; see
|
||||
@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
|
||||
for the accepted syntax.
|
||||
If set this option is used instead of @var{start_sample}.
|
||||
Specify time for starting to apply the fade effect. Default is 0.
|
||||
The accepted syntax is:
|
||||
@example
|
||||
[-]HH[:MM[:SS[.m...]]]
|
||||
[-]S+[.m...]
|
||||
@end example
|
||||
See also the function @code{av_parse_time()}.
|
||||
If set this option is used instead of @var{start_sample} one.
|
||||
|
||||
@item duration, d
|
||||
Specify the duration of the fade effect. See
|
||||
@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
|
||||
for the accepted syntax.
|
||||
Specify the duration for which the fade effect has to last. Default is 0.
|
||||
The accepted syntax is:
|
||||
@example
|
||||
[-]HH[:MM[:SS[.m...]]]
|
||||
[-]S+[.m...]
|
||||
@end example
|
||||
See also the function @code{av_parse_time()}.
|
||||
At the end of the fade-in effect the output audio will have the same
|
||||
volume as the input audio, at the end of the fade-out transition
|
||||
the output audio will be silence.
|
||||
By default the duration is determined by @var{nb_samples}.
|
||||
If set this option is used instead of @var{nb_samples}.
|
||||
If set this option is used instead of @var{nb_samples} one.
|
||||
|
||||
@item curve
|
||||
Set curve for fade transition.
|
||||
@@ -736,58 +742,8 @@ Pass the audio source unchanged to the output.
|
||||
|
||||
@section apad
|
||||
|
||||
Pad the end of an audio stream with silence.
|
||||
|
||||
This can be used together with @command{ffmpeg} @option{-shortest} to
|
||||
extend audio streams to the same length as the video stream.
|
||||
|
||||
A description of the accepted options follows.
|
||||
|
||||
@table @option
|
||||
@item packet_size
|
||||
Set silence packet size. Default value is 4096.
|
||||
|
||||
@item pad_len
|
||||
Set the number of samples of silence to add to the end. After the
|
||||
value is reached, the stream is terminated. This option is mutually
|
||||
exclusive with @option{whole_len}.
|
||||
|
||||
@item whole_len
|
||||
Set the minimum total number of samples in the output audio stream. If
|
||||
the value is longer than the input audio length, silence is added to
|
||||
the end, until the value is reached. This option is mutually exclusive
|
||||
with @option{pad_len}.
|
||||
@end table
|
||||
|
||||
If neither the @option{pad_len} nor the @option{whole_len} option is
|
||||
set, the filter will add silence to the end of the input stream
|
||||
indefinitely.
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Add 1024 samples of silence to the end of the input:
|
||||
@example
|
||||
apad=pad_len=1024
|
||||
@end example
|
||||
|
||||
@item
|
||||
Make sure the audio output will contain at least 10000 samples, pad
|
||||
the input with silence if required:
|
||||
@example
|
||||
apad=whole_len=10000
|
||||
@end example
|
||||
|
||||
@item
|
||||
Use @command{ffmpeg} to pad the audio input with silence, so that the
|
||||
video stream will always result the shortest and will be converted
|
||||
until the end in the output file when using the @option{shortest}
|
||||
option:
|
||||
@example
|
||||
ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT
|
||||
@end example
|
||||
@end itemize
|
||||
Pad the end of a audio stream with silence, this can be used together with
|
||||
-shortest to extend audio streams to the same length as the video stream.
|
||||
|
||||
@section aphaser
|
||||
Add a phasing effect to the input audio.
|
||||
@@ -906,7 +862,7 @@ The input audio is not modified.
|
||||
The shown line contains a sequence of key/value pairs of the form
|
||||
@var{key}:@var{value}.
|
||||
|
||||
The following values are shown in the output:
|
||||
It accepts the following parameters:
|
||||
|
||||
@table @option
|
||||
@item n
|
||||
@@ -1114,9 +1070,9 @@ The number of the first sample that should be output.
|
||||
The number of the first sample that should be dropped.
|
||||
@end table
|
||||
|
||||
@option{start}, @option{end}, and @option{duration} are expressed as time
|
||||
duration specifications; see
|
||||
@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
|
||||
@option{start}, @option{end}, @option{duration} are expressed as time
|
||||
duration specifications, check the "Time duration" section in the
|
||||
ffmpeg-utils manual.
|
||||
|
||||
Note that the first two sets of the start/end options and the @option{duration}
|
||||
option look at the frame timestamp, while the _sample options simply count the
|
||||
@@ -1631,9 +1587,9 @@ Set the number of samples per channel per each output frame, default
|
||||
is 1024. Only used if plugin have zero inputs.
|
||||
|
||||
@item duration, d
|
||||
Set the minimum duration of the sourced audio. See
|
||||
@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
|
||||
for the accepted syntax.
|
||||
Set the minimum duration of the sourced audio. See the function
|
||||
@code{av_parse_time()} for the accepted format, also check the "Time duration"
|
||||
section in the ffmpeg-utils manual.
|
||||
Note that the resulting duration may be greater than the specified duration,
|
||||
as the generated audio is always cut at the end of a complete frame.
|
||||
If not specified, or the expressed duration is negative, the audio is
|
||||
@@ -1875,75 +1831,6 @@ ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section silenceremove
|
||||
|
||||
Remove silence from the beginning, middle or end of the audio.
|
||||
|
||||
The filter accepts the following options:
|
||||
|
||||
@table @option
|
||||
@item start_periods
|
||||
This value is used to indicate if audio should be trimmed at beginning of
|
||||
the audio. A value of zero indicates no silence should be trimmed from the
|
||||
beginning. When specifying a non-zero value, it trims audio up until it
|
||||
finds non-silence. Normally, when trimming silence from beginning of audio
|
||||
the @var{start_periods} will be @code{1} but it can be increased to higher
|
||||
values to trim all audio up to specific count of non-silence periods.
|
||||
Default value is @code{0}.
|
||||
|
||||
@item start_duration
|
||||
Specify the amount of time that non-silence must be detected before it stops
|
||||
trimming audio. By increasing the duration, bursts of noises can be treated
|
||||
as silence and trimmed off. Default value is @code{0}.
|
||||
|
||||
@item start_threshold
|
||||
This indicates what sample value should be treated as silence. For digital
|
||||
audio, a value of @code{0} may be fine but for audio recorded from analog,
|
||||
you may wish to increase the value to account for background noise.
|
||||
Can be specified in dB (in case "dB" is appended to the specified value)
|
||||
or amplitude ratio. Default value is @code{0}.
|
||||
|
||||
@item stop_periods
|
||||
Set the count for trimming silence from the end of audio.
|
||||
To remove silence from the middle of a file, specify a @var{stop_periods}
|
||||
that is negative. This value is then threated as a positive value and is
|
||||
used to indicate the effect should restart processing as specified by
|
||||
@var{start_periods}, making it suitable for removing periods of silence
|
||||
in the middle of the audio.
|
||||
Default value is @code{0}.
|
||||
|
||||
@item stop_duration
|
||||
Specify a duration of silence that must exist before audio is not copied any
|
||||
more. By specifying a higher duration, silence that is wanted can be left in
|
||||
the audio.
|
||||
Default value is @code{0}.
|
||||
|
||||
@item stop_threshold
|
||||
This is the same as @option{start_threshold} but for trimming silence from
|
||||
the end of audio.
|
||||
Can be specified in dB (in case "dB" is appended to the specified value)
|
||||
or amplitude ratio. Default value is @code{0}.
|
||||
|
||||
@item leave_silence
|
||||
This indicate that @var{stop_duration} length of audio should be left intact
|
||||
at the beginning of each period of silence.
|
||||
For example, if you want to remove long pauses between words but do not want
|
||||
to remove the pauses completely. Default value is @code{0}.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
The following example shows how this filter can be used to start a recording
|
||||
that does not contain the delay at the start which usually occurs between
|
||||
pressing the record button and the start of the performance:
|
||||
@example
|
||||
silenceremove=1:5:0.02
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section treble
|
||||
|
||||
Boost or cut treble (upper) frequencies of the audio using a two-pole
|
||||
@@ -2252,9 +2139,8 @@ Set the channel layout. The number of channels in the specified layout
|
||||
must be equal to the number of specified expressions.
|
||||
|
||||
@item duration, d
|
||||
Set the minimum duration of the sourced audio. See
|
||||
@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
|
||||
for the accepted syntax.
|
||||
Set the minimum duration of the sourced audio. See the function
|
||||
@code{av_parse_time()} for the accepted format.
|
||||
Note that the resulting duration may be greater than the specified
|
||||
duration, as the generated audio is always cut at the end of a
|
||||
complete frame.
|
||||
@@ -2869,42 +2755,6 @@ boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chrom
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section codecview
|
||||
|
||||
Visualize information exported by some codecs.
|
||||
|
||||
Some codecs can export information through frames using side-data or other
|
||||
means. For example, some MPEG based codecs export motion vectors through the
|
||||
@var{export_mvs} flag in the codec @option{flags2} option.
|
||||
|
||||
The filter accepts the following option:
|
||||
|
||||
@table @option
|
||||
@item mv
|
||||
Set motion vectors to visualize.
|
||||
|
||||
Available flags for @var{mv} are:
|
||||
|
||||
@table @samp
|
||||
@item pf
|
||||
forward predicted MVs of P-frames
|
||||
@item bf
|
||||
forward predicted MVs of B-frames
|
||||
@item bb
|
||||
backward predicted MVs of B-frames
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Visualizes multi-directionals MVs from P and B-Frames using @command{ffplay}:
|
||||
@example
|
||||
ffplay -flags2 +export_mvs input.mpg -vf codecview=mv=pf+bf+bb
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section colorbalance
|
||||
Modify intensity of primary colors (red, green and blue) of input frames.
|
||||
|
||||
@@ -3369,7 +3219,7 @@ curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
|
||||
|
||||
Denoise frames using 2D DCT (frequency domain filtering).
|
||||
|
||||
This filter is not designed for real time.
|
||||
This filter is not designed for real time and can be extremely slow.
|
||||
|
||||
The filter accepts the following options:
|
||||
|
||||
@@ -3385,14 +3235,14 @@ If you need a more advanced filtering, see @option{expr}.
|
||||
Default is @code{0}.
|
||||
|
||||
@item overlap
|
||||
Set number overlapping pixels for each block. Since the filter can be slow, you
|
||||
may want to reduce this value, at the cost of a less effective filter and the
|
||||
risk of various artefacts.
|
||||
Set number overlapping pixels for each block. Each block is of size
|
||||
@code{16x16}. Since the filter can be slow, you may want to reduce this value,
|
||||
at the cost of a less effective filter and the risk of various artefacts.
|
||||
|
||||
If the overlapping value doesn't permit processing the whole input width or
|
||||
If the overlapping value doesn't allow to process the whole input width or
|
||||
height, a warning will be displayed and according borders won't be denoised.
|
||||
|
||||
Default value is @var{blocksize}-1, which is the best possible setting.
|
||||
Default value is @code{15}.
|
||||
|
||||
@item expr, e
|
||||
Set the coefficient factor expression.
|
||||
@@ -3404,15 +3254,6 @@ If this is option is set, the @option{sigma} option will be ignored.
|
||||
|
||||
The absolute value of the coefficient can be accessed through the @var{c}
|
||||
variable.
|
||||
|
||||
@item n
|
||||
Set the @var{blocksize} using the number of bits. @code{1<<@var{n}} defines the
|
||||
@var{blocksize}, which is the width and height of the processed blocks.
|
||||
|
||||
The default value is @var{3} (8x8) and can be raised to @var{4} for a
|
||||
@var{blocksize} of 16x16. Note that changing this setting has huge consequences
|
||||
on the speed processing. Also, a larger block size does not necessarily means a
|
||||
better de-noising.
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
@@ -3427,11 +3268,6 @@ The same operation can be achieved using the expression system:
|
||||
dctdnoiz=e='gte(c, 4.5*3)'
|
||||
@end example
|
||||
|
||||
Violent denoise using a block size of @code{16x16}:
|
||||
@example
|
||||
dctdnoiz=15:n=4
|
||||
@end example
|
||||
|
||||
@anchor{decimate}
|
||||
@section decimate
|
||||
|
||||
@@ -3862,11 +3698,6 @@ the "Color" section in the ffmpeg-utils manual.
|
||||
|
||||
The default value of @var{fontcolor} is "black".
|
||||
|
||||
@item fontcolor_expr
|
||||
String which is expanded the same way as @var{text} to obtain dynamic
|
||||
@var{fontcolor} value. By default this option has empty value and is not
|
||||
processed. When this option is set, it overrides @var{fontcolor} option.
|
||||
|
||||
@item font
|
||||
The font family to be used for drawing text. By default Sans.
|
||||
|
||||
@@ -4080,15 +3911,6 @@ example the text size is not known when evaluating the expression, so
|
||||
the constants @var{text_w} and @var{text_h} will have an undefined
|
||||
value.
|
||||
|
||||
@item expr_int_format, eif
|
||||
Evaluate the expression's value and output as formatted integer.
|
||||
|
||||
The first argument is the expression to be evaluated, just as for the @var{expr} function.
|
||||
The second argument specifies the output format. Allowed values are 'x', 'X', 'd' and
|
||||
'u'. They are treated exactly as in the printf function.
|
||||
The third parameter is optional and sets the number of positions taken by the output.
|
||||
It can be used to add padding with zeros from the left.
|
||||
|
||||
@item gmtime
|
||||
The time at which the filter is running, expressed in UTC.
|
||||
It can accept an argument: a strftime() format string.
|
||||
@@ -4146,7 +3968,7 @@ within the parameter list.
|
||||
@item
|
||||
Show the text at the center of the video frame:
|
||||
@example
|
||||
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2"
|
||||
drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
|
||||
@end example
|
||||
|
||||
@item
|
||||
@@ -4188,17 +4010,6 @@ Print the date of a real-time encoding (see strftime(3)):
|
||||
drawtext='fontfile=FreeSans.ttf:text=%@{localtime:%a %b %d %Y@}'
|
||||
@end example
|
||||
|
||||
@item
|
||||
Show text fading in and out (appearing/disappearing):
|
||||
@example
|
||||
#!/bin/sh
|
||||
DS=1.0 # display start
|
||||
DE=10.0 # display end
|
||||
FID=1.5 # fade in duration
|
||||
FOD=5 # fade out duration
|
||||
ffplay -f lavfi "color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff0000%@{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 @}"
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
For more information about libfreetype, check:
|
||||
@@ -5618,7 +5429,8 @@ Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is @code
|
||||
|
||||
Simple interlacing filter from progressive contents. This interleaves upper (or
|
||||
lower) lines from odd frames with lower (or upper) lines from even frames,
|
||||
halving the frame rate and preserving image height.
|
||||
halving the frame rate and preserving image height. A vertical lowpass filter
|
||||
is always applied in order to avoid twitter effects and reduce moiré patterns.
|
||||
|
||||
@example
|
||||
Original Original New Frame
|
||||
@@ -5638,10 +5450,6 @@ It accepts the following optional parameters:
|
||||
@item scan
|
||||
This determines whether the interlaced frame is taken from the even
|
||||
(tff - default) or odd (bff) lines of the progressive frame.
|
||||
|
||||
@item lowpass
|
||||
Enable (default) or disable the vertical lowpass filter to avoid twitter
|
||||
interlacing and reduce moire patterns.
|
||||
@end table
|
||||
|
||||
@section kerndeint
|
||||
@@ -5696,51 +5504,6 @@ kerndeint=map=1
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section lenscorrection
|
||||
|
||||
Correct radial lens distortion
|
||||
|
||||
This filter can be used to correct for radial distortion as can result from the use
|
||||
of wide angle lenses, and thereby re-rectify the image. To find the right parameters
|
||||
one can use tools available for example as part of opencv or simply trial-and-error.
|
||||
To use opencv use the calibration sample (under samples/cpp) from the opencv sources
|
||||
and extract the k1 and k2 coefficients from the resulting matrix.
|
||||
|
||||
Note that effectively the same filter is available in the open-source tools Krita and
|
||||
Digikam from the KDE project.
|
||||
|
||||
In contrast to the @ref{vignette} filter, which can also be used to compensate lens errors,
|
||||
this filter corrects the distortion of the image, whereas @ref{vignette} corrects the
|
||||
brightness distribution, so you may want to use both filters together in certain
|
||||
cases, though you will have to take care of ordering, i.e. whether vignetting should
|
||||
be applied before or after lens correction.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The filter accepts the following options:
|
||||
|
||||
@table @option
|
||||
@item cx
|
||||
Relative x-coordinate of the focal point of the image, and thereby the center of the
|
||||
distrortion. This value has a range [0,1] and is expressed as fractions of the image
|
||||
width.
|
||||
@item cy
|
||||
Relative y-coordinate of the focal point of the image, and thereby the center of the
|
||||
distrortion. This value has a range [0,1] and is expressed as fractions of the image
|
||||
height.
|
||||
@item k1
|
||||
Coefficient of the quadratic correction term. 0.5 means no correction.
|
||||
@item k2
|
||||
Coefficient of the double quadratic correction term. 0.5 means no correction.
|
||||
@end table
|
||||
|
||||
The formula that generates the correction is:
|
||||
|
||||
@var{r_src} = @var{r_tgt} * (1 + @var{k1} * (@var{r_tgt} / @var{r_0})^2 + @var{k2} * (@var{r_tgt} / @var{r_0})^4)
|
||||
|
||||
where @var{r_0} is halve of the image diagonal and @var{r_src} and @var{r_tgt} are the
|
||||
distances from the focal point in the source and target images, respectively.
|
||||
|
||||
@anchor{lut3d}
|
||||
@section lut3d
|
||||
|
||||
@@ -7750,7 +7513,7 @@ The input video is not modified.
|
||||
The shown line contains a sequence of key/value pairs of the form
|
||||
@var{key}:@var{value}.
|
||||
|
||||
The following values are shown in the output:
|
||||
It accepts the following parameters:
|
||||
|
||||
@table @option
|
||||
@item n
|
||||
@@ -8610,10 +8373,9 @@ The number of the first frame that should be passed to the output.
|
||||
The number of the first frame that should be dropped.
|
||||
@end table
|
||||
|
||||
@option{start}, @option{end}, and @option{duration} are expressed as time
|
||||
duration specifications; see
|
||||
@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
|
||||
for the accepted syntax.
|
||||
@option{start}, @option{end}, @option{duration} are expressed as time
|
||||
duration specifications, check the "Time duration" section in the
|
||||
ffmpeg-utils manual.
|
||||
|
||||
Note that the first two sets of the start/end options and the @option{duration}
|
||||
option look at the frame timestamp, while the _frame variants simply count the
|
||||
@@ -8954,7 +8716,6 @@ For example, to vertically flip a video with @command{ffmpeg}:
|
||||
ffmpeg -i in.avi -vf "vflip" out.avi
|
||||
@end example
|
||||
|
||||
@anchor{vignette}
|
||||
@section vignette
|
||||
|
||||
Make or reverse a natural vignetting effect.
|
||||
@@ -9524,9 +9285,12 @@ number or a valid video frame rate abbreviation. The default value is
|
||||
"25".
|
||||
|
||||
@item duration, d
|
||||
Set the duration of the sourced video. See
|
||||
@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
|
||||
for the accepted syntax.
|
||||
Set the video duration of the sourced video. The accepted syntax is:
|
||||
@example
|
||||
[-]HH:MM:SS[.m...]
|
||||
[-]S+[.m...]
|
||||
@end example
|
||||
See also the function @code{av_parse_time()}.
|
||||
|
||||
If not specified, or the expressed duration is negative, the video is
|
||||
supposed to be generated forever.
|
||||
@@ -9554,7 +9318,7 @@ Default value is "all", which will cycle through the list of all tests.
|
||||
|
||||
Some examples:
|
||||
@example
|
||||
mptestsrc=t=dc_luma
|
||||
testsrc=t=dc_luma
|
||||
@end example
|
||||
|
||||
will generate a "dc_luma" test pattern.
|
||||
@@ -9788,9 +9552,12 @@ number or a valid video frame rate abbreviation. The default value is
|
||||
Set the sample aspect ratio of the sourced video.
|
||||
|
||||
@item duration, d
|
||||
Set the duration of the sourced video. See
|
||||
@ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}
|
||||
for the accepted syntax.
|
||||
Set the video duration of the sourced video. The accepted syntax is:
|
||||
@example
|
||||
[-]HH[:MM[:SS[.m...]]]
|
||||
[-]S+[.m...]
|
||||
@end example
|
||||
Also see the the @code{av_parse_time()} function.
|
||||
|
||||
If not specified, or the expressed duration is negative, the video is
|
||||
supposed to be generated forever.
|
||||
@@ -10706,34 +10473,8 @@ The filter accepts the following options:
|
||||
|
||||
@table @option
|
||||
@item volume
|
||||
Specify transform volume (multiplier) expression. The expression can contain
|
||||
variables:
|
||||
@table @option
|
||||
@item frequency, freq, f
|
||||
the frequency where transform is evaluated
|
||||
@item timeclamp, tc
|
||||
value of timeclamp option
|
||||
@end table
|
||||
and functions:
|
||||
@table @option
|
||||
@item a_weighting(f)
|
||||
A-weighting of equal loudness
|
||||
@item b_weighting(f)
|
||||
B-weighting of equal loudness
|
||||
@item c_weighting(f)
|
||||
C-weighting of equal loudness
|
||||
@end table
|
||||
Default value is @code{16}.
|
||||
|
||||
@item tlength
|
||||
Specify transform length expression. The expression can contain variables:
|
||||
@table @option
|
||||
@item frequency, freq, f
|
||||
the frequency where transform is evaluated
|
||||
@item timeclamp, tc
|
||||
value of timeclamp option
|
||||
@end table
|
||||
Default value is @code{384/f*tc/(384/f+tc)}.
|
||||
Specify the transform volume (multiplier). Acceptable value is [1.0, 100.0].
|
||||
Default value is @code{16.0}.
|
||||
|
||||
@item timeclamp
|
||||
Specify the transform timeclamp. At low frequency, there is trade-off between
|
||||
@@ -10755,26 +10496,6 @@ Default value is @code{3.0}.
|
||||
@item fontfile
|
||||
Specify font file for use with freetype. If not specified, use embedded font.
|
||||
|
||||
@item fontcolor
|
||||
Specify font color expression. This is arithmetic expression that should return
|
||||
integer value 0xRRGGBB. The expression can contain variables:
|
||||
@table @option
|
||||
@item frequency, freq, f
|
||||
the frequency where transform is evaluated
|
||||
@item timeclamp, tc
|
||||
value of timeclamp option
|
||||
@end table
|
||||
and functions:
|
||||
@table @option
|
||||
@item midi(f)
|
||||
midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
|
||||
@item r(x), g(x), b(x)
|
||||
red, green, and blue value of intensity x
|
||||
@end table
|
||||
Default value is @code{st(0, (midi(f)-59.5)/12);
|
||||
st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
|
||||
r(1-ld(1)) + b(ld(1))}
|
||||
|
||||
@item fullhd
|
||||
If set to 1 (the default), the video size is 1920x1080 (full HD),
|
||||
if set to 0, the video size is 960x540. Use this option to make CPU usage lower.
|
||||
@@ -10824,24 +10545,6 @@ ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*
|
||||
asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
|
||||
@end example
|
||||
|
||||
@item
|
||||
B-weighting of equal loudness
|
||||
@example
|
||||
volume=16*b_weighting(f)
|
||||
@end example
|
||||
|
||||
@item
|
||||
Lower Q factor
|
||||
@example
|
||||
tlength=100/f*tc/(100/f+tc)
|
||||
@end example
|
||||
|
||||
@item
|
||||
Custom fontcolor, C-note is colored green, others are colored blue
|
||||
@example
|
||||
fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))'
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
@section showspectrum
|
||||
@@ -10858,19 +10561,8 @@ the "Video size" section in the ffmpeg-utils manual. Default value is
|
||||
@code{640x512}.
|
||||
|
||||
@item slide
|
||||
Specify how the spectrum should slide along the window.
|
||||
|
||||
It accepts the following values:
|
||||
@table @samp
|
||||
@item replace
|
||||
the samples start again on the left when they reach the right
|
||||
@item scroll
|
||||
the samples scroll from right to left
|
||||
@item fullframe
|
||||
frames are only produced when the samples reach the right
|
||||
@end table
|
||||
|
||||
Default value is @code{replace}.
|
||||
Specify if the spectrum should slide along the window. Default value is
|
||||
@code{0}.
|
||||
|
||||
@item mode
|
||||
Specify display mode.
|
||||
@@ -10981,12 +10673,6 @@ Draw a point for each sample.
|
||||
|
||||
@item line
|
||||
Draw a vertical line for each sample.
|
||||
|
||||
@item p2p
|
||||
Draw a point for each sample and a line between them.
|
||||
|
||||
@item cline
|
||||
Draw a centered vertical line for each sample.
|
||||
@end table
|
||||
|
||||
Default value is @code{point}.
|
||||
@@ -11001,9 +10687,6 @@ is not explicitly specified.
|
||||
Set the (approximate) output frame rate. This is done by setting the
|
||||
option @var{n}. Default value is "25".
|
||||
|
||||
@item split_channels
|
||||
Set if channels should be drawn separately or overlap. Default value is 0.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
@@ -23,7 +23,7 @@ Reduce buffering.
|
||||
|
||||
@item probesize @var{integer} (@emph{input})
|
||||
Set probing size in bytes, i.e. the size of the data to analyze to get
|
||||
stream information. A higher value will enable detecting more
|
||||
stream information. A higher value will allow to detect more
|
||||
information in case it is dispersed into the stream, but will increase
|
||||
latency. Must be an integer not lesser than 32. It is 5000000 by default.
|
||||
|
||||
@@ -63,7 +63,7 @@ Default is 0.
|
||||
|
||||
@item analyzeduration @var{integer} (@emph{input})
|
||||
Specify how many microseconds are analyzed to probe the input. A
|
||||
higher value will enable detecting more accurate information, but will
|
||||
higher value will allow to detect more accurate information, but will
|
||||
increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
|
||||
|
||||
@item cryptokey @var{hexadecimal string} (@emph{input})
|
||||
|
@@ -130,7 +130,7 @@ Go to @url{http://x265.org/developers.html} and follow the instructions
|
||||
for installing the library. Then pass @code{--enable-libx265} to configure
|
||||
to enable it.
|
||||
|
||||
@float NOTE
|
||||
@float note
|
||||
x265 is under the GNU Public License Version 2 or later
|
||||
(see @url{http://www.gnu.org/licenses/old-licenses/gpl-2.0.html} for
|
||||
details), you must upgrade FFmpeg's license to GPL in order to use it.
|
||||
@@ -935,8 +935,8 @@ following image formats are supported:
|
||||
@item Musepack SV8 @tab @tab X
|
||||
@item Nellymoser Asao @tab X @tab X
|
||||
@item On2 AVC (Audio for Video Codec) @tab @tab X
|
||||
@item Opus @tab E @tab X
|
||||
@tab encoding supported through external library libopus
|
||||
@item Opus @tab E @tab E
|
||||
@tab supported through external library libopus
|
||||
@item PCM A-law @tab X @tab X
|
||||
@item PCM mu-law @tab X @tab X
|
||||
@item PCM signed 8-bit planar @tab X @tab X
|
||||
@@ -1055,7 +1055,6 @@ performance on systems without hardware floating point support).
|
||||
@item HLS @tab X
|
||||
@item HTTP @tab X
|
||||
@item HTTPS @tab X
|
||||
@item Icecast @tab X
|
||||
@item MMSH @tab X
|
||||
@item MMST @tab X
|
||||
@item pipe @tab X
|
||||
|
@@ -1,7 +1,7 @@
|
||||
@chapter Input Devices
|
||||
@c man begin INPUT DEVICES
|
||||
|
||||
Input devices are configured elements in FFmpeg which enable accessing
|
||||
Input devices are configured elements in FFmpeg which allow to access
|
||||
the data coming from a multimedia device attached to your system.
|
||||
|
||||
When you configure your FFmpeg build, all the supported input devices
|
||||
@@ -483,28 +483,10 @@ ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
|
||||
|
||||
@end itemize
|
||||
|
||||
@section libcdio
|
||||
|
||||
Audio-CD input device based on cdio.
|
||||
|
||||
To enable this input device during configuration you need libcdio
|
||||
installed on your system. Requires the configure option
|
||||
@code{--enable-libcdio}.
|
||||
|
||||
This device allows playing and grabbing from an Audio-CD.
|
||||
|
||||
For example to copy with @command{ffmpeg} the entire Audio-CD in /dev/sr0,
|
||||
you may run the command:
|
||||
@example
|
||||
ffmpeg -f libcdio -i /dev/sr0 cd.wav
|
||||
@end example
|
||||
|
||||
@section libdc1394
|
||||
|
||||
IIDC1394 input device, based on libdc1394 and libraw1394.
|
||||
|
||||
Requires the configure option @code{--enable-libdc1394}.
|
||||
|
||||
@section openal
|
||||
|
||||
The OpenAL input device provides audio capture on all systems with a
|
||||
@@ -833,9 +815,6 @@ other filename will be interpreted as device number 0.
|
||||
|
||||
X11 video input device.
|
||||
|
||||
Depends on X11, Xext, and Xfixes. Requires the configure option
|
||||
@code{--enable-x11grab}.
|
||||
|
||||
This device allows one to capture a region of an X11 display.
|
||||
|
||||
The filename passed as input has the syntax:
|
||||
@@ -916,10 +895,6 @@ ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_siz
|
||||
|
||||
@item video_size
|
||||
Set the video frame size. Default value is @code{vga}.
|
||||
|
||||
@item use_shm
|
||||
Use the MIT-SHM extension for shared memory. Default value is @code{1}.
|
||||
It may be necessary to disable it for remote displays.
|
||||
@end table
|
||||
|
||||
@c man end INPUT DEVICES
|
||||
|
@@ -22,7 +22,7 @@ a mail for every change to every issue.
|
||||
(the above does all work already after light testing)
|
||||
|
||||
The subscription URL for the ffmpeg-trac list is:
|
||||
http(s)://lists.ffmpeg.org/mailman/listinfo/ffmpeg-trac
|
||||
http(s)://ffmpeg.org/mailman/listinfo/ffmpeg-trac
|
||||
The URL of the webinterface of the tracker is:
|
||||
http(s)://trac.ffmpeg.org
|
||||
|
||||
|
@@ -551,12 +551,6 @@ This operation can take a while, and will not work in various situations such
|
||||
as fragmented output, thus it is not enabled by default.
|
||||
@item -movflags rtphint
|
||||
Add RTP hinting tracks to the output file.
|
||||
@item -movflags disable_chpl
|
||||
Disable Nero chapter markers (chpl atom). Normally, both Nero chapters
|
||||
and a QuickTime chapter track are written to the file. With this option
|
||||
set, only the QuickTime chapter track will be written. Nero chapters can
|
||||
cause failures when the file is reprocessed with certain tagging programs, like
|
||||
mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well.
|
||||
@end table
|
||||
|
||||
@subsection Example
|
||||
@@ -804,11 +798,6 @@ reference stream. The default value is @code{auto}.
|
||||
Override the inner container format, by default it is guessed by the filename
|
||||
extension.
|
||||
|
||||
@item segment_format_options @var{options_list}
|
||||
Set output format options using a :-separated list of key=value
|
||||
parameters. Values containing the @code{:} special character must be
|
||||
escaped.
|
||||
|
||||
@item segment_list @var{name}
|
||||
Generate also a listfile named @var{name}. If not specified no
|
||||
listfile is generated.
|
||||
@@ -833,7 +822,7 @@ Select the listing format.
|
||||
@end table
|
||||
|
||||
@item segment_list_size @var{size}
|
||||
Update the list file so that it contains at most @var{size}
|
||||
Update the list file so that it contains at most the last @var{size}
|
||||
segments. If 0 the list file will contain all the segments. Default
|
||||
value is 0.
|
||||
|
||||
@@ -956,7 +945,7 @@ argument must be a time duration specification, and defaults to 0.
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Remux the content of file @file{in.mkv} to a list of segments
|
||||
To remux the content of file @file{in.mkv} to a list of segments
|
||||
@file{out-000.nut}, @file{out-001.nut}, etc., and write the list of
|
||||
generated segments to @file{out.list}:
|
||||
@example
|
||||
@@ -964,20 +953,14 @@ ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nu
|
||||
@end example
|
||||
|
||||
@item
|
||||
Segment input and set output format options for the output segments:
|
||||
@example
|
||||
ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
|
||||
@end example
|
||||
|
||||
@item
|
||||
Segment the input file according to the split points specified by the
|
||||
@var{segment_times} option:
|
||||
As the example above, but segment the input file according to the split
|
||||
points specified by the @var{segment_times} option:
|
||||
@example
|
||||
ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
|
||||
@end example
|
||||
|
||||
@item
|
||||
Use the @command{ffmpeg} @option{force_key_frames}
|
||||
As the example above, but use the @command{ffmpeg} @option{force_key_frames}
|
||||
option to force key frames in the input at the specified location, together
|
||||
with the segment option @option{segment_time_delta} to account for
|
||||
possible roundings operated when setting key frame times.
|
||||
@@ -996,7 +979,7 @@ ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_fr
|
||||
@end example
|
||||
|
||||
@item
|
||||
Convert the @file{in.mkv} to TS segments using the @code{libx264}
|
||||
To convert the @file{in.mkv} to TS segments using the @code{libx264}
|
||||
and @code{libfaac} encoders:
|
||||
@example
|
||||
ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a libfaac -f ssegment -segment_list out.list out%03d.ts
|
||||
|
@@ -35,9 +35,6 @@ to your project LDFLAGS:
|
||||
-Wl,-Bsymbolic
|
||||
@end example
|
||||
|
||||
If your target platform requires position independent binaries, you should
|
||||
pass the correct linking flag (e.g. @code{-pie}) to @code{--extra-ldexeflags}.
|
||||
|
||||
@section BSD
|
||||
|
||||
BSD make will not build FFmpeg, you need to install and use GNU Make
|
||||
@@ -135,6 +132,8 @@ You will need the following prerequisites:
|
||||
(if using MSVC 2012 or earlier)
|
||||
@item @uref{http://www.mingw.org/, MSYS}
|
||||
@item @uref{http://yasm.tortall.net/, YASM}
|
||||
@item @uref{http://gnuwin32.sourceforge.net/packages/bc.htm, bc for Windows} if
|
||||
you want to run @uref{fate.html, FATE}.
|
||||
@end itemize
|
||||
|
||||
To set up a proper environment in MSYS, you need to run @code{msys.bat} from
|
||||
@@ -276,12 +275,12 @@ llrint() in its C library.
|
||||
Install your Cygwin with all the "Base" packages, plus the
|
||||
following "Devel" ones:
|
||||
@example
|
||||
binutils, gcc4-core, make, git, mingw-runtime, texinfo
|
||||
binutils, gcc4-core, make, git, mingw-runtime, texi2html
|
||||
@end example
|
||||
|
||||
In order to run FATE you will also need the following "Utils" packages:
|
||||
@example
|
||||
diffutils
|
||||
bc, diffutils
|
||||
@end example
|
||||
|
||||
If you want to build FFmpeg with additional libraries, download Cygwin
|
||||
|
@@ -255,7 +255,7 @@ Export the MIME type.
|
||||
If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
|
||||
supports this, the metadata has to be retrieved by the application by reading
|
||||
the @option{icy_metadata_headers} and @option{icy_metadata_packet} options.
|
||||
The default is 1.
|
||||
The default is 0.
|
||||
|
||||
@item icy_metadata_headers
|
||||
If the server supports ICY metadata, this contains the ICY-specific HTTP reply
|
||||
@@ -293,50 +293,6 @@ The required syntax to play a stream specifying a cookie is:
|
||||
ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
|
||||
@end example
|
||||
|
||||
@section Icecast
|
||||
|
||||
Icecast protocol (stream to Icecast servers)
|
||||
|
||||
This protocol accepts the following options:
|
||||
|
||||
@table @option
|
||||
@item ice_genre
|
||||
Set the stream genre.
|
||||
|
||||
@item ice_name
|
||||
Set the stream name.
|
||||
|
||||
@item ice_description
|
||||
Set the stream description.
|
||||
|
||||
@item ice_url
|
||||
Set the stream website URL.
|
||||
|
||||
@item ice_public
|
||||
Set if the stream should be public.
|
||||
The default is 0 (not public).
|
||||
|
||||
@item user_agent
|
||||
Override the User-Agent header. If not specified a string of the form
|
||||
"Lavf/<version>" will be used.
|
||||
|
||||
@item password
|
||||
Set the Icecast mountpoint password.
|
||||
|
||||
@item content_type
|
||||
Set the stream content type. This must be set if it is different from
|
||||
audio/mpeg.
|
||||
|
||||
@item legacy_icecast
|
||||
This enables support for Icecast versions < 2.4.0, that do not support the
|
||||
HTTP PUT method but the SOURCE method.
|
||||
|
||||
@end table
|
||||
|
||||
@example
|
||||
icecast://[@var{username}[:@var{password}]@@]@var{server}:@var{port}/@var{mountpoint}
|
||||
@end example
|
||||
|
||||
@section mmst
|
||||
|
||||
MMS (Microsoft Media Server) protocol over TCP.
|
||||
@@ -583,7 +539,7 @@ firewalls.
|
||||
|
||||
@section libsmbclient
|
||||
|
||||
libsmbclient permits one to manipulate CIFS/SMB network resources.
|
||||
libsmbclient permits to manipulate CIFS/SMB network resources.
|
||||
|
||||
Following syntax is required.
|
||||
|
||||
@@ -1081,8 +1037,8 @@ Set raise error timeout, expressed in microseconds.
|
||||
This option is only relevant in read mode: if no data arrived in more
|
||||
than this time interval, raise error.
|
||||
|
||||
@item listen_timeout=@var{milliseconds}
|
||||
Set listen timeout, expressed in milliseconds.
|
||||
@item listen_timeout=@var{microseconds}
|
||||
Set listen timeout, expressed in microseconds.
|
||||
@end table
|
||||
|
||||
The following example shows how to setup a listening TCP connection
|
||||
|
@@ -618,6 +618,7 @@ flip wavelet?
|
||||
try to use the wavelet transformed predicted image (motion compensated image) as context for coding the residual coefficients
|
||||
try the MV length as context for coding the residual coefficients
|
||||
use extradata for stuff which is in the keyframes now?
|
||||
the MV median predictor is patented IIRC
|
||||
implement per picture halfpel interpolation
|
||||
try different range coder state transition tables for different contexts
|
||||
|
||||
|
23
doc/style.min.css
vendored
23
doc/style.min.css
vendored
File diff suppressed because one or more lines are too long
59
doc/t2h.init
59
doc/t2h.init
@@ -1,35 +1,26 @@
|
||||
# Init file for texi2html.
|
||||
|
||||
# This is deprecated, and the makeinfo/texi2any version is doc/t2h.pm
|
||||
|
||||
# no horiz rules between sections
|
||||
$end_section = \&FFmpeg_end_section;
|
||||
sub FFmpeg_end_section($$)
|
||||
{
|
||||
}
|
||||
|
||||
my $TEMPLATE_HEADER1 = $ENV{"FFMPEG_HEADER1"} || <<EOT;
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>FFmpeg documentation</title>
|
||||
<link rel="stylesheet" href="bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="style.min.css" />
|
||||
$EXTRA_HEAD =
|
||||
'<link rel="icon" href="favicon.png" type="image/png" />
|
||||
';
|
||||
|
||||
$CSS_LINES = $ENV{"FFMPEG_CSS"} || <<EOT;
|
||||
<link rel="stylesheet" type="text/css" href="default.css" />
|
||||
EOT
|
||||
|
||||
my $TEMPLATE_HEADER2 = $ENV{"FFMPEG_HEADER2"} || <<EOT;
|
||||
</head>
|
||||
<body>
|
||||
<div style="width: 95%; margin: auto">
|
||||
my $TEMPLATE_HEADER = $ENV{"FFMPEG_HEADER"} || <<EOT;
|
||||
<link rel="icon" href="favicon.png" type="image/png" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="body">
|
||||
EOT
|
||||
|
||||
my $TEMPLATE_FOOTER = $ENV{"FFMPEG_FOOTER"} || <<EOT;
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOT
|
||||
$PRE_BODY_CLOSE = '</div></div>';
|
||||
|
||||
$SMALL_RULE = '';
|
||||
$BODYTEXT = '';
|
||||
@@ -91,25 +82,21 @@ sub FFmpeg_print_page_head($$)
|
||||
$longtitle = "FFmpeg documentation : " . $longtitle;
|
||||
|
||||
print $fh <<EOT;
|
||||
$TEMPLATE_HEADER1
|
||||
$description
|
||||
<meta name="keywords" content="$longtitle">
|
||||
<meta name="Generator" content="$Texi2HTML::THISDOC{program}">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
$Texi2HTML::THISDOC{'copying'}<!-- Created on $Texi2HTML::THISDOC{today} by $Texi2HTML::THISDOC{program} -->
|
||||
<!--
|
||||
$Texi2HTML::THISDOC{program_authors}
|
||||
-->
|
||||
$encoding
|
||||
$TEMPLATE_HEADER2
|
||||
EOT
|
||||
}
|
||||
<head>
|
||||
<title>$longtitle</title>
|
||||
|
||||
$print_page_foot = \&FFmpeg_print_page_foot;
|
||||
sub FFmpeg_print_page_foot($$)
|
||||
{
|
||||
my $fh = shift;
|
||||
print $fh <<EOT;
|
||||
$TEMPLATE_FOOTER
|
||||
$description
|
||||
<meta name="keywords" content="$longtitle">
|
||||
<meta name="Generator" content="$Texi2HTML::THISDOC{program}">
|
||||
$encoding
|
||||
$CSS_LINES
|
||||
$TEMPLATE_HEADER
|
||||
EOT
|
||||
}
|
||||
|
||||
|
221
doc/t2h.pm
221
doc/t2h.pm
@@ -1,221 +0,0 @@
|
||||
# makeinfo HTML output init file
|
||||
#
|
||||
# Copyright (c) 2011, 2012 Free Software Foundation, Inc.
|
||||
# Copyright (c) 2014 Andreas Cadhalpun
|
||||
# Copyright (c) 2014 Tiancheng "Timothy" Gu
|
||||
#
|
||||
# This file is part of FFmpeg.
|
||||
#
|
||||
# FFmpeg is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# FFmpeg 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
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# License along with FFmpeg; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# no navigation elements
|
||||
set_from_init_file('HEADERS', 0);
|
||||
|
||||
# TOC and Chapter headings link
|
||||
set_from_init_file('TOC_LINKS', 1);
|
||||
|
||||
# print the TOC where @contents is used
|
||||
set_from_init_file('INLINE_CONTENTS', 1);
|
||||
|
||||
# make chapters <h2>
|
||||
set_from_init_file('CHAPTER_HEADER_LEVEL', 2);
|
||||
|
||||
# Do not add <hr>
|
||||
set_from_init_file('DEFAULT_RULE', '');
|
||||
set_from_init_file('BIG_RULE', '');
|
||||
|
||||
# Customized file beginning
|
||||
sub ffmpeg_begin_file($$$)
|
||||
{
|
||||
my $self = shift;
|
||||
my $filename = shift;
|
||||
my $element = shift;
|
||||
|
||||
my $command;
|
||||
if ($element and $self->get_conf('SPLIT')) {
|
||||
$command = $self->element_command($element);
|
||||
}
|
||||
|
||||
my ($title, $description, $encoding, $date, $css_lines,
|
||||
$doctype, $bodytext, $copying_comment, $after_body_open,
|
||||
$extra_head, $program_and_version, $program_homepage,
|
||||
$program, $generator) = $self->_file_header_informations($command);
|
||||
|
||||
my $links = $self->_get_links ($filename, $element);
|
||||
|
||||
my $head1 = $ENV{"FFMPEG_HEADER1"} || <<EOT;
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- Created by $program_and_version, $program_homepage -->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
EOT
|
||||
my $head_title = <<EOT;
|
||||
$title
|
||||
EOT
|
||||
|
||||
my $head2 = $ENV{"FFMPEG_HEADER2"} || <<EOT;
|
||||
</title>
|
||||
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="style.min.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="width: 95%; margin: auto">
|
||||
<h1>
|
||||
EOT
|
||||
|
||||
my $head3 = $ENV{"FFMPEG_HEADER3"} || <<EOT;
|
||||
</h1>
|
||||
EOT
|
||||
|
||||
return $head1 . $head_title . $head2 . $head_title . $head3;
|
||||
}
|
||||
texinfo_register_formatting_function('begin_file', \&ffmpeg_begin_file);
|
||||
|
||||
# Customized file ending
|
||||
sub ffmpeg_end_file($)
|
||||
{
|
||||
my $self = shift;
|
||||
my $program_string = &{$self->{'format_program_string'}}($self);
|
||||
my $program_text = <<EOT;
|
||||
<p style="font-size: small;">
|
||||
$program_string
|
||||
</p>
|
||||
EOT
|
||||
my $footer = $ENV{FFMPEG_FOOTER} || <<EOT;
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOT
|
||||
return $program_text . $footer;
|
||||
}
|
||||
texinfo_register_formatting_function('end_file', \&ffmpeg_end_file);
|
||||
|
||||
# Dummy title command
|
||||
# Ignore title. Title is handled through ffmpeg_begin_file().
|
||||
set_from_init_file('USE_TITLEPAGE_FOR_TITLE', 1);
|
||||
sub ffmpeg_title($$$$)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
texinfo_register_command_formatting('titlefont',
|
||||
\&ffmpeg_title);
|
||||
|
||||
# Customized float command. Part of code borrowed from GNU Texinfo.
|
||||
sub ffmpeg_float($$$$$)
|
||||
{
|
||||
my $self = shift;
|
||||
my $cmdname = shift;
|
||||
my $command = shift;
|
||||
my $args = shift;
|
||||
my $content = shift;
|
||||
|
||||
my ($caption, $prepended) = Texinfo::Common::float_name_caption($self,
|
||||
$command);
|
||||
my $caption_text = '';
|
||||
my $prepended_text;
|
||||
my $prepended_save = '';
|
||||
|
||||
if ($self->in_string()) {
|
||||
if ($prepended) {
|
||||
$prepended_text = $self->convert_tree_new_formatting_context(
|
||||
$prepended, 'float prepended');
|
||||
} else {
|
||||
$prepended_text = '';
|
||||
}
|
||||
if ($caption) {
|
||||
$caption_text = $self->convert_tree_new_formatting_context(
|
||||
{'contents' => $caption->{'args'}->[0]->{'contents'}},
|
||||
'float caption');
|
||||
}
|
||||
return $prepended.$content.$caption_text;
|
||||
}
|
||||
|
||||
my $id = $self->command_id($command);
|
||||
my $label;
|
||||
if (defined($id) and $id ne '') {
|
||||
$label = "<a name=\"$id\"></a>";
|
||||
} else {
|
||||
$label = '';
|
||||
}
|
||||
|
||||
if ($prepended) {
|
||||
if ($caption) {
|
||||
# prepend the prepended tree to the first paragraph
|
||||
my @caption_original_contents = @{$caption->{'args'}->[0]->{'contents'}};
|
||||
my @caption_contents;
|
||||
my $new_paragraph;
|
||||
while (@caption_original_contents) {
|
||||
my $content = shift @caption_original_contents;
|
||||
if ($content->{'type'} and $content->{'type'} eq 'paragraph') {
|
||||
%{$new_paragraph} = %{$content};
|
||||
$new_paragraph->{'contents'} = [@{$content->{'contents'}}];
|
||||
unshift (@{$new_paragraph->{'contents'}}, {'cmdname' => 'strong',
|
||||
'args' => [{'type' => 'brace_command_arg',
|
||||
'contents' => [$prepended]}]});
|
||||
push @caption_contents, $new_paragraph;
|
||||
last;
|
||||
} else {
|
||||
push @caption_contents, $content;
|
||||
}
|
||||
}
|
||||
push @caption_contents, @caption_original_contents;
|
||||
if ($new_paragraph) {
|
||||
$caption_text = $self->convert_tree_new_formatting_context(
|
||||
{'contents' => \@caption_contents}, 'float caption');
|
||||
$prepended_text = '';
|
||||
}
|
||||
}
|
||||
if ($caption_text eq '') {
|
||||
$prepended_text = $self->convert_tree_new_formatting_context(
|
||||
$prepended, 'float prepended');
|
||||
if ($prepended_text ne '') {
|
||||
$prepended_save = $prepended_text;
|
||||
$prepended_text = '<p><strong>'.$prepended_text.'</strong></p>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$prepended_text = '';
|
||||
}
|
||||
|
||||
if ($caption and $caption_text eq '') {
|
||||
$caption_text = $self->convert_tree_new_formatting_context(
|
||||
$caption->{'args'}->[0], 'float caption');
|
||||
}
|
||||
if ($prepended_text.$caption_text ne '') {
|
||||
$prepended_text = $self->_attribute_class('div','float-caption'). '>'
|
||||
. $prepended_text;
|
||||
$caption_text .= '</div>';
|
||||
}
|
||||
my $html_class = '';
|
||||
if ($prepended_save =~ /NOTE/) {
|
||||
$html_class = 'info';
|
||||
$prepended_text = '';
|
||||
$caption_text = '';
|
||||
} elsif ($prepended_save =~ /IMPORTANT/) {
|
||||
$html_class = 'warning';
|
||||
$prepended_text = '';
|
||||
$caption_text = '';
|
||||
}
|
||||
return $self->_attribute_class('div', $html_class). '>' . "\n" .
|
||||
$prepended_text . $caption_text . $content . '</div>';
|
||||
}
|
||||
|
||||
texinfo_register_command_formatting('float',
|
||||
\&ffmpeg_float);
|
||||
|
||||
1;
|
@@ -332,12 +332,12 @@ $inf = pop @instack;
|
||||
|
||||
die "No filename or title\n" unless defined $fn && defined $tl;
|
||||
|
||||
# always use utf8
|
||||
print "=encoding utf8\n\n";
|
||||
|
||||
$chapters{NAME} = "$fn \- $tl\n";
|
||||
$chapters{FOOTNOTES} .= "=back\n" if exists $chapters{FOOTNOTES};
|
||||
|
||||
# always use utf8
|
||||
print "=encoding utf8\n\n";
|
||||
|
||||
unshift @chapters_sequence, "NAME";
|
||||
for $chapter (@chapters_sequence) {
|
||||
if (exists $chapters{$chapter}) {
|
||||
|
@@ -782,9 +782,6 @@ large numbers (usually 2^53 and larger).
|
||||
Round the value of expression @var{expr} upwards to the nearest
|
||||
integer. For example, "ceil(1.5)" is "2.0".
|
||||
|
||||
@item clip(x, min, max)
|
||||
Return the value of @var{x} clipped between @var{min} and @var{max}.
|
||||
|
||||
@item cos(x)
|
||||
Compute cosine of @var{x}.
|
||||
|
||||
@@ -844,7 +841,7 @@ Return 1.0 if @var{x} is +/-INFINITY, 0.0 otherwise.
|
||||
Return 1.0 if @var{x} is NAN, 0.0 otherwise.
|
||||
|
||||
@item ld(var)
|
||||
Load the value of the internal variable with number
|
||||
Allow to load the value of the internal variable with number
|
||||
@var{var}, which was previously stored with st(@var{var}, @var{expr}).
|
||||
The function returns the loaded value.
|
||||
|
||||
@@ -861,7 +858,7 @@ Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
|
||||
Return the maximum between @var{x} and @var{y}.
|
||||
|
||||
@item min(x, y)
|
||||
Return the minimum between @var{x} and @var{y}.
|
||||
Return the maximum between @var{x} and @var{y}.
|
||||
|
||||
@item mod(x, y)
|
||||
Compute the remainder of division of @var{x} by @var{y}.
|
||||
@@ -912,7 +909,7 @@ Compute the square root of @var{expr}. This is equivalent to
|
||||
Compute expression @code{1/(1 + exp(4*x))}.
|
||||
|
||||
@item st(var, expr)
|
||||
Store the value of the expression @var{expr} in an internal
|
||||
Allow to store the value of the expression @var{expr} in an internal
|
||||
variable. @var{var} specifies the number of the variable where to
|
||||
store the value, and it is a value ranging from 0 to 9. The function
|
||||
returns the value stored in the internal variable.
|
||||
|
138
ffmpeg.c
138
ffmpeg.c
@@ -352,6 +352,7 @@ void term_init(void)
|
||||
signal(SIGQUIT, sigterm_handler); /* Quit (POSIX). */
|
||||
}
|
||||
#endif
|
||||
avformat_network_deinit();
|
||||
|
||||
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
|
||||
signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
|
||||
@@ -466,12 +467,7 @@ static void ffmpeg_cleanup(int ret)
|
||||
}
|
||||
for (i = 0; i < nb_output_streams; i++) {
|
||||
OutputStream *ost = output_streams[i];
|
||||
AVBitStreamFilterContext *bsfc;
|
||||
|
||||
if (!ost)
|
||||
continue;
|
||||
|
||||
bsfc = ost->bitstream_filters;
|
||||
AVBitStreamFilterContext *bsfc = ost->bitstream_filters;
|
||||
while (bsfc) {
|
||||
AVBitStreamFilterContext *next = bsfc->next;
|
||||
av_bitstream_filter_close(bsfc);
|
||||
@@ -487,9 +483,6 @@ static void ffmpeg_cleanup(int ret)
|
||||
av_freep(&ost->avfilter);
|
||||
av_freep(&ost->logfile_prefix);
|
||||
|
||||
av_freep(&ost->audio_channels_map);
|
||||
ost->audio_channels_mapped = 0;
|
||||
|
||||
avcodec_free_context(&ost->enc_ctx);
|
||||
|
||||
av_freep(&output_streams[i]);
|
||||
@@ -539,15 +532,6 @@ static void ffmpeg_cleanup(int ret)
|
||||
term_exit();
|
||||
}
|
||||
|
||||
void remove_avoptions(AVDictionary **a, AVDictionary *b)
|
||||
{
|
||||
AVDictionaryEntry *t = NULL;
|
||||
|
||||
while ((t = av_dict_get(b, "", t, AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE);
|
||||
}
|
||||
}
|
||||
|
||||
void assert_avoptions(AVDictionary *m)
|
||||
{
|
||||
AVDictionaryEntry *t;
|
||||
@@ -591,17 +575,9 @@ static void close_all_output_streams(OutputStream *ost, OSTFinished this_stream,
|
||||
static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
|
||||
{
|
||||
AVBitStreamFilterContext *bsfc = ost->bitstream_filters;
|
||||
AVCodecContext *avctx = ost->encoding_needed ? ost->enc_ctx : ost->st->codec;
|
||||
AVCodecContext *avctx = ost->st->codec;
|
||||
int ret;
|
||||
|
||||
if (!ost->st->codec->extradata_size && ost->enc_ctx->extradata_size) {
|
||||
ost->st->codec->extradata = av_mallocz(ost->enc_ctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (ost->st->codec->extradata) {
|
||||
memcpy(ost->st->codec->extradata, ost->enc_ctx->extradata, ost->enc_ctx->extradata_size);
|
||||
ost->st->codec->extradata_size = ost->enc_ctx->extradata_size;
|
||||
}
|
||||
}
|
||||
|
||||
if ((avctx->codec_type == AVMEDIA_TYPE_VIDEO && video_sync_method == VSYNC_DROP) ||
|
||||
(avctx->codec_type == AVMEDIA_TYPE_AUDIO && audio_sync_method < 0))
|
||||
pkt->pts = pkt->dts = AV_NOPTS_VALUE;
|
||||
@@ -642,15 +618,12 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
|
||||
a = AVERROR(ENOMEM);
|
||||
}
|
||||
if (a > 0) {
|
||||
pkt->side_data = NULL;
|
||||
pkt->side_data_elems = 0;
|
||||
av_free_packet(pkt);
|
||||
new_pkt.buf = av_buffer_create(new_pkt.data, new_pkt.size,
|
||||
av_buffer_default_free, NULL, 0);
|
||||
if (!new_pkt.buf)
|
||||
exit_program(1);
|
||||
} else if (a < 0) {
|
||||
new_pkt = *pkt;
|
||||
av_log(NULL, AV_LOG_ERROR, "Failed to open bitstream filter %s for stream %d with codec %s",
|
||||
bsfc->filter->name, pkt->stream_index,
|
||||
avctx->codec ? avctx->codec->name : "copy");
|
||||
@@ -983,8 +956,10 @@ static void do_video_out(AVFormatContext *s,
|
||||
/* raw pictures are written as AVPicture structure to
|
||||
avoid any copies. We support temporarily the older
|
||||
method. */
|
||||
if (in_picture->interlaced_frame)
|
||||
mux_enc->field_order = in_picture->top_field_first ? AV_FIELD_TB:AV_FIELD_BT;
|
||||
mux_enc->coded_frame->interlaced_frame = in_picture->interlaced_frame;
|
||||
mux_enc->coded_frame->top_field_first = in_picture->top_field_first;
|
||||
if (mux_enc->coded_frame->interlaced_frame)
|
||||
mux_enc->field_order = mux_enc->coded_frame->top_field_first ? AV_FIELD_TB:AV_FIELD_BT;
|
||||
else
|
||||
mux_enc->field_order = AV_FIELD_PROGRESSIVE;
|
||||
pkt.data = (uint8_t *)in_picture;
|
||||
@@ -1687,21 +1662,17 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
|
||||
|
||||
opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->st->time_base);
|
||||
opkt.flags = pkt->flags;
|
||||
|
||||
// FIXME remove the following 2 lines they shall be replaced by the bitstream filters
|
||||
if ( ost->st->codec->codec_id != AV_CODEC_ID_H264
|
||||
&& ost->st->codec->codec_id != AV_CODEC_ID_MPEG1VIDEO
|
||||
&& ost->st->codec->codec_id != AV_CODEC_ID_MPEG2VIDEO
|
||||
&& ost->st->codec->codec_id != AV_CODEC_ID_VC1
|
||||
if ( ost->enc_ctx->codec_id != AV_CODEC_ID_H264
|
||||
&& ost->enc_ctx->codec_id != AV_CODEC_ID_MPEG1VIDEO
|
||||
&& ost->enc_ctx->codec_id != AV_CODEC_ID_MPEG2VIDEO
|
||||
&& ost->enc_ctx->codec_id != AV_CODEC_ID_VC1
|
||||
) {
|
||||
int ret = av_parser_change(ost->parser, ost->st->codec,
|
||||
if (av_parser_change(ost->parser, ost->st->codec,
|
||||
&opkt.data, &opkt.size,
|
||||
pkt->data, pkt->size,
|
||||
pkt->flags & AV_PKT_FLAG_KEY);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "av_parser_change failed\n");
|
||||
exit_program(1);
|
||||
}
|
||||
if (ret) {
|
||||
pkt->flags & AV_PKT_FLAG_KEY)) {
|
||||
opkt.buf = av_buffer_create(opkt.data, opkt.size, av_buffer_default_free, NULL, 0);
|
||||
if (!opkt.buf)
|
||||
exit_program(1);
|
||||
@@ -1712,15 +1683,9 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
|
||||
}
|
||||
av_copy_packet_side_data(&opkt, pkt);
|
||||
|
||||
if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
|
||||
ost->st->codec->codec_id == AV_CODEC_ID_RAWVIDEO &&
|
||||
(of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
|
||||
if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) {
|
||||
/* store AVPicture in AVPacket, as expected by the output format */
|
||||
int ret = avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "avpicture_fill failed\n");
|
||||
exit_program(1);
|
||||
}
|
||||
avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height);
|
||||
opkt.data = (uint8_t *)&pict;
|
||||
opkt.size = sizeof(AVPicture);
|
||||
opkt.flags |= AV_PKT_FLAG_KEY;
|
||||
@@ -1834,10 +1799,18 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
|
||||
for (i = 0; i < nb_filtergraphs; i++)
|
||||
if (ist_in_filtergraph(filtergraphs[i], ist)) {
|
||||
FilterGraph *fg = filtergraphs[i];
|
||||
int j;
|
||||
if (configure_filtergraph(fg) < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n");
|
||||
exit_program(1);
|
||||
}
|
||||
for (j = 0; j < fg->nb_outputs; j++) {
|
||||
OutputStream *ost = fg->outputs[j]->ost;
|
||||
if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
|
||||
!(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
|
||||
av_buffersink_set_frame_size(ost->filter->filter,
|
||||
ost->enc_ctx->frame_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2075,7 +2048,7 @@ out:
|
||||
}
|
||||
|
||||
/* pkt = NULL means EOF (needed to flush decoder buffers) */
|
||||
static int process_input_packet(InputStream *ist, const AVPacket *pkt)
|
||||
static int output_packet(InputStream *ist, const AVPacket *pkt)
|
||||
{
|
||||
int ret = 0, i;
|
||||
int got_output = 0;
|
||||
@@ -2084,7 +2057,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
|
||||
if (!ist->saw_first_ts) {
|
||||
ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
|
||||
ist->pts = 0;
|
||||
if (pkt && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) {
|
||||
if (pkt != NULL && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) {
|
||||
ist->dts += av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q);
|
||||
ist->pts = ist->dts; //unused but better to set it to a value thats not totally wrong
|
||||
}
|
||||
@@ -2096,7 +2069,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
|
||||
if (ist->next_pts == AV_NOPTS_VALUE)
|
||||
ist->next_pts = ist->pts;
|
||||
|
||||
if (!pkt) {
|
||||
if (pkt == NULL) {
|
||||
/* EOF handling */
|
||||
av_init_packet(&avpkt);
|
||||
avpkt.data = NULL;
|
||||
@@ -2310,12 +2283,8 @@ static int init_input_stream(int ist_index, char *error, int error_len)
|
||||
ist->dec_ctx->thread_safe_callbacks = 1;
|
||||
|
||||
av_opt_set_int(ist->dec_ctx, "refcounted_frames", 1, 0);
|
||||
if (ist->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE &&
|
||||
(ist->decoding_needed & DECODING_FOR_OST)) {
|
||||
av_dict_set(&ist->decoder_opts, "compute_edt", "1", AV_DICT_DONT_OVERWRITE);
|
||||
if (ist->decoding_needed & DECODING_FOR_FILTER)
|
||||
av_log(NULL, AV_LOG_WARNING, "Warning using DVB subtitles for filtering and output at the same time is not fully supported, also see -compute_edt [0|1]\n");
|
||||
}
|
||||
if(ist->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE)
|
||||
av_dict_set(&ist->decoder_opts, "compute_edt", "1", 0);
|
||||
|
||||
if (!av_dict_get(ist->decoder_opts, "threads", NULL, 0))
|
||||
av_dict_set(&ist->decoder_opts, "threads", "auto", 0);
|
||||
@@ -2476,7 +2445,7 @@ static int transcode_init(void)
|
||||
AVFormatContext *oc;
|
||||
OutputStream *ost;
|
||||
InputStream *ist;
|
||||
char error[1024] = {0};
|
||||
char error[1024];
|
||||
int want_sdp = 1;
|
||||
|
||||
for (i = 0; i < nb_filtergraphs; i++) {
|
||||
@@ -2528,7 +2497,7 @@ static int transcode_init(void)
|
||||
if (ost->attachment_filename)
|
||||
continue;
|
||||
|
||||
enc_ctx = ost->stream_copy ? ost->st->codec : ost->enc_ctx;
|
||||
enc_ctx = ost->enc_ctx;
|
||||
|
||||
if (ist) {
|
||||
dec_ctx = ist->dec_ctx;
|
||||
@@ -2575,13 +2544,11 @@ static int transcode_init(void)
|
||||
enc_ctx->rc_max_rate = dec_ctx->rc_max_rate;
|
||||
enc_ctx->rc_buffer_size = dec_ctx->rc_buffer_size;
|
||||
enc_ctx->field_order = dec_ctx->field_order;
|
||||
if (dec_ctx->extradata_size) {
|
||||
enc_ctx->extradata = av_mallocz(extra_size);
|
||||
if (!enc_ctx->extradata) {
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
memcpy(enc_ctx->extradata, dec_ctx->extradata, dec_ctx->extradata_size);
|
||||
enc_ctx->extradata = av_mallocz(extra_size);
|
||||
if (!enc_ctx->extradata) {
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
memcpy(enc_ctx->extradata, dec_ctx->extradata, dec_ctx->extradata_size);
|
||||
enc_ctx->extradata_size= dec_ctx->extradata_size;
|
||||
enc_ctx->bits_per_coded_sample = dec_ctx->bits_per_coded_sample;
|
||||
|
||||
@@ -2697,7 +2664,7 @@ static int transcode_init(void)
|
||||
}
|
||||
|
||||
if (ist)
|
||||
ist->decoding_needed |= DECODING_FOR_OST;
|
||||
ist->decoding_needed++;
|
||||
ost->encoding_needed = 1;
|
||||
|
||||
set_encoder_id(output_files[ost->file_index], ost);
|
||||
@@ -2896,26 +2863,24 @@ static int transcode_init(void)
|
||||
if (ost->enc_ctx->bit_rate && ost->enc_ctx->bit_rate < 1000)
|
||||
av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
|
||||
" It takes bits/s as argument, not kbits/s\n");
|
||||
|
||||
ret = avcodec_copy_context(ost->st->codec, ost->enc_ctx);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL,
|
||||
"Error initializing the output stream codec context.\n");
|
||||
exit_program(1);
|
||||
}
|
||||
|
||||
// copy timebase while removing common factors
|
||||
ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
|
||||
ost->st->codec->codec= ost->enc_ctx->codec;
|
||||
} else {
|
||||
if (av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts) < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL,
|
||||
"Error setting up codec context options.\n");
|
||||
exit_program(1);
|
||||
}
|
||||
// copy timebase while removing common factors
|
||||
ost->st->time_base = av_add_q(ost->st->codec->time_base, (AVRational){0, 1});
|
||||
}
|
||||
|
||||
ret = avcodec_copy_context(ost->st->codec, ost->enc_ctx);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL,
|
||||
"Error initializing the output stream codec context.\n");
|
||||
exit_program(1);
|
||||
}
|
||||
ost->st->codec->codec= ost->enc_ctx->codec;
|
||||
|
||||
// copy timebase while removing common factors
|
||||
ost->st->time_base = av_add_q(ost->enc_ctx->time_base, (AVRational){0, 1});
|
||||
}
|
||||
|
||||
/* init input streams */
|
||||
@@ -3366,7 +3331,7 @@ static int process_input(int file_index)
|
||||
for (i = 0; i < ifile->nb_streams; i++) {
|
||||
ist = input_streams[ifile->ist_index + i];
|
||||
if (ist->decoding_needed) {
|
||||
ret = process_input_packet(ist, NULL);
|
||||
ret = output_packet(ist, NULL);
|
||||
if (ret>0)
|
||||
return 0;
|
||||
}
|
||||
@@ -3454,7 +3419,7 @@ static int process_input(int file_index)
|
||||
}
|
||||
|
||||
/* add the stream-global side data to the first packet */
|
||||
if (ist->nb_packets == 1) {
|
||||
if (ist->nb_packets == 1)
|
||||
if (ist->st->nb_side_data)
|
||||
av_packet_split_side_data(&pkt);
|
||||
for (i = 0; i < ist->st->nb_side_data; i++) {
|
||||
@@ -3470,7 +3435,6 @@ static int process_input(int file_index)
|
||||
|
||||
memcpy(dst_data, src_sd->data, src_sd->size);
|
||||
}
|
||||
}
|
||||
|
||||
if (pkt.dts != AV_NOPTS_VALUE)
|
||||
pkt.dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base);
|
||||
@@ -3548,7 +3512,7 @@ static int process_input(int file_index)
|
||||
|
||||
sub2video_heartbeat(ist, pkt.pts);
|
||||
|
||||
ret = process_input_packet(ist, &pkt);
|
||||
ret = output_packet(ist, &pkt);
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d: %s\n",
|
||||
ist->file_index, ist->st->index, av_err2str(ret));
|
||||
@@ -3714,7 +3678,7 @@ static int transcode(void)
|
||||
for (i = 0; i < nb_input_streams; i++) {
|
||||
ist = input_streams[i];
|
||||
if (!input_files[ist->file_index]->eof_reached && ist->decoding_needed) {
|
||||
process_input_packet(ist, NULL);
|
||||
output_packet(ist, NULL);
|
||||
}
|
||||
}
|
||||
flush_encoders();
|
||||
|
8
ffmpeg.h
8
ffmpeg.h
@@ -243,10 +243,7 @@ typedef struct InputStream {
|
||||
AVStream *st;
|
||||
int discard; /* true if stream data should be discarded */
|
||||
int user_set_discard;
|
||||
int decoding_needed; /* non zero if the packets must be decoded in 'raw_fifo', see DECODING_FOR_* */
|
||||
#define DECODING_FOR_OST 1
|
||||
#define DECODING_FOR_FILTER 2
|
||||
|
||||
int decoding_needed; /* true if the packets must be decoded in 'raw_fifo' */
|
||||
AVCodecContext *dec_ctx;
|
||||
AVCodec *dec;
|
||||
AVFrame *decoded_frame;
|
||||
@@ -405,7 +402,7 @@ typedef struct OutputStream {
|
||||
double forced_keyframes_expr_const_values[FKF_NB];
|
||||
|
||||
/* audio only */
|
||||
int *audio_channels_map; /* list of the channels id to pick from the source stream */
|
||||
int audio_channels_map[SWR_CH_MAX]; /* list of the channels id to pick from the source stream */
|
||||
int audio_channels_mapped; /* number of channels in audio_channels_map */
|
||||
|
||||
char *logfile_prefix;
|
||||
@@ -505,7 +502,6 @@ void show_usage(void);
|
||||
|
||||
void opt_output_file(void *optctx, const char *filename);
|
||||
|
||||
void remove_avoptions(AVDictionary **a, AVDictionary *b);
|
||||
void assert_avoptions(AVDictionary *m);
|
||||
|
||||
int guess_input_channel_layout(InputStream *ist);
|
||||
|
@@ -275,7 +275,7 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
|
||||
av_assert0(ist);
|
||||
|
||||
ist->discard = 0;
|
||||
ist->decoding_needed |= DECODING_FOR_FILTER;
|
||||
ist->decoding_needed++;
|
||||
ist->st->discard = AVDISCARD_NONE;
|
||||
|
||||
GROW_ARRAY(fg->inputs, fg->nb_inputs);
|
||||
@@ -830,12 +830,6 @@ static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
av_freep(&ifilter->name);
|
||||
DESCRIBE_FILTER_LINK(ifilter, in, 1);
|
||||
|
||||
if (!ifilter->ist->dec) {
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"No decoder for stream #%d:%d, filtering impossible\n",
|
||||
ifilter->ist->file_index, ifilter->ist->st->index);
|
||||
return AVERROR_DECODER_NOT_FOUND;
|
||||
}
|
||||
switch (avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx)) {
|
||||
case AVMEDIA_TYPE_VIDEO: return configure_input_video_filter(fg, ifilter, in);
|
||||
case AVMEDIA_TYPE_AUDIO: return configure_input_audio_filter(fg, ifilter, in);
|
||||
@@ -898,11 +892,8 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
init_input_filter(fg, cur);
|
||||
|
||||
for (cur = inputs, i = 0; cur; cur = cur->next, i++)
|
||||
if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0) {
|
||||
avfilter_inout_free(&inputs);
|
||||
avfilter_inout_free(&outputs);
|
||||
if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0)
|
||||
return ret;
|
||||
}
|
||||
avfilter_inout_free(&inputs);
|
||||
|
||||
if (!init || simple) {
|
||||
@@ -928,16 +919,6 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
}
|
||||
|
||||
fg->reconfiguration = 1;
|
||||
|
||||
for (i = 0; i < fg->nb_outputs; i++) {
|
||||
OutputStream *ost = fg->outputs[i]->ost;
|
||||
if (ost &&
|
||||
ost->enc->type == AVMEDIA_TYPE_AUDIO &&
|
||||
!(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
|
||||
av_buffersink_set_frame_size(ost->filter->filter,
|
||||
ost->enc_ctx->frame_size);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
125
ffmpeg_opt.c
125
ffmpeg_opt.c
@@ -702,7 +702,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
|
||||
MATCH_PER_STREAM_OPT(fix_sub_duration, i, ist->fix_sub_duration, ic, st);
|
||||
MATCH_PER_STREAM_OPT(canvas_sizes, str, canvas_size, ic, st);
|
||||
if (canvas_size &&
|
||||
av_parse_video_size(&ist->dec_ctx->width, &ist->dec_ctx->height, canvas_size) < 0) {
|
||||
av_parse_video_size(&dec->width, &dec->height, canvas_size) < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid canvas size: %s.\n", canvas_size);
|
||||
exit_program(1);
|
||||
}
|
||||
@@ -785,6 +785,7 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
AVInputFormat *file_iformat = NULL;
|
||||
int err, i, ret;
|
||||
int64_t timestamp;
|
||||
uint8_t buf[128];
|
||||
AVDictionary **opts;
|
||||
AVDictionary *unused_opts = NULL;
|
||||
AVDictionaryEntry *e = NULL;
|
||||
@@ -813,7 +814,8 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
exit_program(1);
|
||||
}
|
||||
if (o->nb_audio_sample_rate) {
|
||||
av_dict_set_int(&o->g->format_opts, "sample_rate", o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i, 0);
|
||||
snprintf(buf, sizeof(buf), "%d", o->audio_sample_rate[o->nb_audio_sample_rate - 1].u.i);
|
||||
av_dict_set(&o->g->format_opts, "sample_rate", buf, 0);
|
||||
}
|
||||
if (o->nb_audio_channels) {
|
||||
/* because we set audio_channels based on both the "ac" and
|
||||
@@ -822,7 +824,9 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
if (file_iformat && file_iformat->priv_class &&
|
||||
av_opt_find(&file_iformat->priv_class, "channels", NULL, 0,
|
||||
AV_OPT_SEARCH_FAKE_OBJ)) {
|
||||
av_dict_set_int(&o->g->format_opts, "channels", o->audio_channels[o->nb_audio_channels - 1].u.i, 0);
|
||||
snprintf(buf, sizeof(buf), "%d",
|
||||
o->audio_channels[o->nb_audio_channels - 1].u.i);
|
||||
av_dict_set(&o->g->format_opts, "channels", buf, 0);
|
||||
}
|
||||
}
|
||||
if (o->nb_frame_rates) {
|
||||
@@ -868,7 +872,6 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
print_error(filename, err);
|
||||
exit_program(1);
|
||||
}
|
||||
remove_avoptions(&o->g->format_opts, o->g->codec_opts);
|
||||
assert_avoptions(o->g->format_opts);
|
||||
|
||||
/* apply forced codec ids */
|
||||
@@ -1474,13 +1477,11 @@ static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
}
|
||||
|
||||
if (!ist || (ist->file_index == map->file_idx && ist->st->index == map->stream_idx)) {
|
||||
if (av_reallocp_array(&ost->audio_channels_map,
|
||||
ost->audio_channels_mapped + 1,
|
||||
sizeof(*ost->audio_channels_map)
|
||||
) < 0 )
|
||||
exit_program(1);
|
||||
|
||||
ost->audio_channels_map[ost->audio_channels_mapped++] = map->channel_idx;
|
||||
if (ost->audio_channels_mapped < FF_ARRAY_ELEMS(ost->audio_channels_map))
|
||||
ost->audio_channels_map[ost->audio_channels_mapped++] = map->channel_idx;
|
||||
else
|
||||
av_log(NULL, AV_LOG_FATAL, "Max channel mapping for output %d.%d reached\n",
|
||||
ost->file_index, ost->st->index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1827,7 +1828,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
/* pick the "best" stream of each type */
|
||||
|
||||
/* video: highest resolution */
|
||||
if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) {
|
||||
if (!o->video_disable && oc->oformat->video_codec != AV_CODEC_ID_NONE) {
|
||||
int area = 0, idx = -1;
|
||||
int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
|
||||
for (i = 0; i < nb_input_streams; i++) {
|
||||
@@ -1849,7 +1850,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
}
|
||||
|
||||
/* audio: most channels */
|
||||
if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
|
||||
if (!o->audio_disable && oc->oformat->audio_codec != AV_CODEC_ID_NONE) {
|
||||
int channels = 0, idx = -1;
|
||||
for (i = 0; i < nb_input_streams; i++) {
|
||||
ist = input_streams[i];
|
||||
@@ -1868,27 +1869,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
if (!o->subtitle_disable && (avcodec_find_encoder(oc->oformat->subtitle_codec) || subtitle_codec_name)) {
|
||||
for (i = 0; i < nb_input_streams; i++)
|
||||
if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
|
||||
AVCodecDescriptor const *input_descriptor =
|
||||
avcodec_descriptor_get(input_streams[i]->st->codec->codec_id);
|
||||
AVCodecDescriptor const *output_descriptor = NULL;
|
||||
AVCodec const *output_codec =
|
||||
avcodec_find_encoder(oc->oformat->subtitle_codec);
|
||||
int input_props = 0, output_props = 0;
|
||||
if (output_codec)
|
||||
output_descriptor = avcodec_descriptor_get(output_codec->id);
|
||||
if (input_descriptor)
|
||||
input_props = input_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB);
|
||||
if (output_descriptor)
|
||||
output_props = output_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB);
|
||||
if (subtitle_codec_name ||
|
||||
input_props & output_props ||
|
||||
// Map dvb teletext which has neither property to any output subtitle encoder
|
||||
input_descriptor && output_descriptor &&
|
||||
(!input_descriptor->props ||
|
||||
!output_descriptor->props)) {
|
||||
new_subtitle_stream(o, oc, i);
|
||||
break;
|
||||
}
|
||||
new_subtitle_stream(o, oc, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* do something with data? */
|
||||
@@ -1977,8 +1959,8 @@ loop_end:
|
||||
ost->stream_copy = 0;
|
||||
ost->attachment_filename = o->attachments[i];
|
||||
ost->finished = 1;
|
||||
ost->st->codec->extradata = attachment;
|
||||
ost->st->codec->extradata_size = len;
|
||||
ost->enc_ctx->extradata = attachment;
|
||||
ost->enc_ctx->extradata_size = len;
|
||||
|
||||
p = strrchr(o->attachments[i], '/');
|
||||
av_dict_set(&ost->st->metadata, "filename", (p && *p) ? p + 1 : o->attachments[i], AV_DICT_DONT_OVERWRITE);
|
||||
@@ -2010,13 +1992,8 @@ loop_end:
|
||||
const AVClass *class = avcodec_get_class();
|
||||
const AVOption *option = av_opt_find(&class, e->key, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
|
||||
const AVClass *fclass = avformat_get_class();
|
||||
const AVOption *foption = av_opt_find(&fclass, e->key, NULL, 0,
|
||||
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ);
|
||||
if (!option || foption)
|
||||
if (!option)
|
||||
continue;
|
||||
|
||||
|
||||
if (!(option->flags & AV_OPT_FLAG_ENCODING_PARAM)) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Codec AVOption %s (%s) specified for "
|
||||
"output file #%d (%s) is not an encoding option.\n", e->key,
|
||||
@@ -2061,7 +2038,9 @@ loop_end:
|
||||
assert_file_overwrite(filename);
|
||||
|
||||
if (o->mux_preload) {
|
||||
av_dict_set_int(&of->opts, "preload", o->mux_preload*AV_TIME_BASE, 0);
|
||||
uint8_t buf[64];
|
||||
snprintf(buf, sizeof(buf), "%d", (int)(o->mux_preload*AV_TIME_BASE));
|
||||
av_dict_set(&of->opts, "preload", buf, 0);
|
||||
}
|
||||
oc->max_delay = (int)(o->mux_max_delay * AV_TIME_BASE);
|
||||
|
||||
@@ -2187,8 +2166,7 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
for (j = 0; j < nb_input_files; j++) {
|
||||
for (i = 0; i < input_files[j]->nb_streams; i++) {
|
||||
AVCodecContext *c = input_files[j]->ctx->streams[i]->codec;
|
||||
if (c->codec_type != AVMEDIA_TYPE_VIDEO ||
|
||||
!c->time_base.num)
|
||||
if (c->codec_type != AVMEDIA_TYPE_VIDEO)
|
||||
continue;
|
||||
fr = c->time_base.den * 1000 / c->time_base.num;
|
||||
if (fr == 25000) {
|
||||
@@ -2221,19 +2199,19 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
|
||||
parse_option(o, "s", norm == PAL ? "352x288" : "352x240", options);
|
||||
parse_option(o, "r", frame_rates[norm], options);
|
||||
opt_default(NULL, "g", norm == PAL ? "15" : "18");
|
||||
av_dict_set(&o->g->codec_opts, "g", norm == PAL ? "15" : "18", AV_DICT_DONT_OVERWRITE);
|
||||
|
||||
opt_default(NULL, "b:v", "1150000");
|
||||
opt_default(NULL, "maxrate:v", "1150000");
|
||||
opt_default(NULL, "minrate:v", "1150000");
|
||||
opt_default(NULL, "bufsize:v", "327680"); // 40*1024*8;
|
||||
av_dict_set(&o->g->codec_opts, "b:v", "1150000", AV_DICT_DONT_OVERWRITE);
|
||||
av_dict_set(&o->g->codec_opts, "maxrate", "1150000", AV_DICT_DONT_OVERWRITE);
|
||||
av_dict_set(&o->g->codec_opts, "minrate", "1150000", AV_DICT_DONT_OVERWRITE);
|
||||
av_dict_set(&o->g->codec_opts, "bufsize", "327680", AV_DICT_DONT_OVERWRITE); // 40*1024*8;
|
||||
|
||||
opt_default(NULL, "b:a", "224000");
|
||||
av_dict_set(&o->g->codec_opts, "b:a", "224000", AV_DICT_DONT_OVERWRITE);
|
||||
parse_option(o, "ar", "44100", options);
|
||||
parse_option(o, "ac", "2", options);
|
||||
|
||||
opt_default(NULL, "packetsize", "2324");
|
||||
opt_default(NULL, "muxrate", "1411200"); // 2352 * 75 * 8;
|
||||
av_dict_set(&o->g->format_opts, "packetsize", "2324", AV_DICT_DONT_OVERWRITE);
|
||||
av_dict_set(&o->g->format_opts, "muxrate", "1411200", AV_DICT_DONT_OVERWRITE); // 2352 * 75 * 8;
|
||||
|
||||
/* We have to offset the PTS, so that it is consistent with the SCR.
|
||||
SCR starts at 36000, but the first two packs contain only padding
|
||||
@@ -2250,18 +2228,18 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
parse_option(o, "s", norm == PAL ? "480x576" : "480x480", options);
|
||||
parse_option(o, "r", frame_rates[norm], options);
|
||||
parse_option(o, "pix_fmt", "yuv420p", options);
|
||||
opt_default(NULL, "g", norm == PAL ? "15" : "18");
|
||||
av_dict_set(&o->g->codec_opts, "g", norm == PAL ? "15" : "18", AV_DICT_DONT_OVERWRITE);
|
||||
|
||||
opt_default(NULL, "b:v", "2040000");
|
||||
opt_default(NULL, "maxrate:v", "2516000");
|
||||
opt_default(NULL, "minrate:v", "0"); // 1145000;
|
||||
opt_default(NULL, "bufsize:v", "1835008"); // 224*1024*8;
|
||||
opt_default(NULL, "scan_offset", "1");
|
||||
av_dict_set(&o->g->codec_opts, "b:v", "2040000", AV_DICT_DONT_OVERWRITE);
|
||||
av_dict_set(&o->g->codec_opts, "maxrate", "2516000", AV_DICT_DONT_OVERWRITE);
|
||||
av_dict_set(&o->g->codec_opts, "minrate", "0", AV_DICT_DONT_OVERWRITE); // 1145000;
|
||||
av_dict_set(&o->g->codec_opts, "bufsize", "1835008", AV_DICT_DONT_OVERWRITE); // 224*1024*8;
|
||||
av_dict_set(&o->g->codec_opts, "scan_offset", "1", AV_DICT_DONT_OVERWRITE);
|
||||
|
||||
opt_default(NULL, "b:a", "224000");
|
||||
av_dict_set(&o->g->codec_opts, "b:a", "224000", AV_DICT_DONT_OVERWRITE);
|
||||
parse_option(o, "ar", "44100", options);
|
||||
|
||||
opt_default(NULL, "packetsize", "2324");
|
||||
av_dict_set(&o->g->format_opts, "packetsize", "2324", AV_DICT_DONT_OVERWRITE);
|
||||
|
||||
} else if (!strcmp(arg, "dvd")) {
|
||||
|
||||
@@ -2272,17 +2250,17 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
parse_option(o, "s", norm == PAL ? "720x576" : "720x480", options);
|
||||
parse_option(o, "r", frame_rates[norm], options);
|
||||
parse_option(o, "pix_fmt", "yuv420p", options);
|
||||
opt_default(NULL, "g", norm == PAL ? "15" : "18");
|
||||
av_dict_set(&o->g->codec_opts, "g", norm == PAL ? "15" : "18", AV_DICT_DONT_OVERWRITE);
|
||||
|
||||
opt_default(NULL, "b:v", "6000000");
|
||||
opt_default(NULL, "maxrate:v", "9000000");
|
||||
opt_default(NULL, "minrate:v", "0"); // 1500000;
|
||||
opt_default(NULL, "bufsize:v", "1835008"); // 224*1024*8;
|
||||
av_dict_set(&o->g->codec_opts, "b:v", "6000000", AV_DICT_DONT_OVERWRITE);
|
||||
av_dict_set(&o->g->codec_opts, "maxrate", "9000000", AV_DICT_DONT_OVERWRITE);
|
||||
av_dict_set(&o->g->codec_opts, "minrate", "0", AV_DICT_DONT_OVERWRITE); // 1500000;
|
||||
av_dict_set(&o->g->codec_opts, "bufsize", "1835008", AV_DICT_DONT_OVERWRITE); // 224*1024*8;
|
||||
|
||||
opt_default(NULL, "packetsize", "2048"); // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
|
||||
opt_default(NULL, "muxrate", "10080000"); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
|
||||
av_dict_set(&o->g->format_opts, "packetsize", "2048", AV_DICT_DONT_OVERWRITE); // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
|
||||
av_dict_set(&o->g->format_opts, "muxrate", "10080000", AV_DICT_DONT_OVERWRITE); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
|
||||
|
||||
opt_default(NULL, "b:a", "448000");
|
||||
av_dict_set(&o->g->codec_opts, "b:a", "448000", AV_DICT_DONT_OVERWRITE);
|
||||
parse_option(o, "ar", "48000", options);
|
||||
|
||||
} else if (!strncmp(arg, "dv", 2)) {
|
||||
@@ -2301,10 +2279,6 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
av_log(NULL, AV_LOG_ERROR, "Unknown target: %s\n", arg);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
av_dict_copy(&o->g->codec_opts, codec_opts, AV_DICT_DONT_OVERWRITE);
|
||||
av_dict_copy(&o->g->format_opts, format_opts, AV_DICT_DONT_OVERWRITE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2321,9 +2295,6 @@ static int opt_vstats(void *optctx, const char *opt, const char *arg)
|
||||
time_t today2 = time(NULL);
|
||||
struct tm *today = localtime(&today2);
|
||||
|
||||
if (!today)
|
||||
return AVERROR(errno);
|
||||
|
||||
snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min,
|
||||
today->tm_sec);
|
||||
return opt_vstats_file(NULL, opt, filename);
|
||||
@@ -2804,7 +2775,7 @@ const OptionDef options[] = {
|
||||
{ "itsscale", HAS_ARG | OPT_DOUBLE | OPT_SPEC |
|
||||
OPT_EXPERT | OPT_INPUT, { .off = OFFSET(ts_scale) },
|
||||
"set the input ts scale", "scale" },
|
||||
{ "timestamp", HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_recording_timestamp },
|
||||
{ "timestamp", HAS_ARG | OPT_PERFILE, { .func_arg = opt_recording_timestamp },
|
||||
"set the recording timestamp ('now' to set the current time)", "time" },
|
||||
{ "metadata", HAS_ARG | OPT_STRING | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(metadata) },
|
||||
"add metadata", "string=string" },
|
||||
|
@@ -77,8 +77,6 @@ static int vda_retrieve_data(AVCodecContext *s, AVFrame *frame)
|
||||
frame->width, frame->height);
|
||||
|
||||
ret = av_frame_copy_props(vda->tmp_frame, frame);
|
||||
CVPixelBufferUnlockBaseAddress(pixbuf, kCVPixelBufferLock_ReadOnly);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
12
ffplay.c
12
ffplay.c
@@ -441,7 +441,7 @@ static void packet_queue_flush(PacketQueue *q)
|
||||
MyAVPacketList *pkt, *pkt1;
|
||||
|
||||
SDL_LockMutex(q->mutex);
|
||||
for (pkt = q->first_pkt; pkt; pkt = pkt1) {
|
||||
for (pkt = q->first_pkt; pkt != NULL; pkt = pkt1) {
|
||||
pkt1 = pkt->next;
|
||||
av_free_packet(&pkt->pkt);
|
||||
av_freep(&pkt);
|
||||
@@ -991,7 +991,7 @@ static void video_audio_display(VideoState *s)
|
||||
av_free(s->rdft_data);
|
||||
s->rdft = av_rdft_init(rdft_bits, DFT_R2C);
|
||||
s->rdft_bits = rdft_bits;
|
||||
s->rdft_data = av_malloc_array(nb_freq, 4 *sizeof(*s->rdft_data));
|
||||
s->rdft_data = av_malloc(4 * nb_freq * sizeof(*s->rdft_data));
|
||||
}
|
||||
{
|
||||
FFTSample *data[2];
|
||||
@@ -1652,7 +1652,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, double
|
||||
is->img_convert_ctx = sws_getCachedContext(is->img_convert_ctx,
|
||||
vp->width, vp->height, src_frame->format, vp->width, vp->height,
|
||||
AV_PIX_FMT_YUV420P, sws_flags, NULL, NULL, NULL);
|
||||
if (!is->img_convert_ctx) {
|
||||
if (is->img_convert_ctx == NULL) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Cannot initialize the conversion context\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -2582,7 +2582,7 @@ static int stream_component_open(VideoState *is, int stream_index)
|
||||
if (!av_dict_get(opts, "threads", NULL, 0))
|
||||
av_dict_set(&opts, "threads", "auto", 0);
|
||||
if (stream_lowres)
|
||||
av_dict_set_int(&opts, "lowres", stream_lowres, 0);
|
||||
av_dict_set(&opts, "lowres", av_asprintf("%d", stream_lowres), AV_DICT_DONT_STRDUP_VAL);
|
||||
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
av_dict_set(&opts, "refcounted_frames", "1", 0);
|
||||
if (avcodec_open2(avctx, codec, &opts) < 0)
|
||||
@@ -2824,7 +2824,7 @@ static int read_thread(void *arg)
|
||||
av_freep(&opts);
|
||||
|
||||
if (ic->pb)
|
||||
ic->pb->eof_reached = 0; // FIXME hack, ffplay maybe should not use avio_feof() to test for the end
|
||||
ic->pb->eof_reached = 0; // FIXME hack, ffplay maybe should not use url_feof() to test for the end
|
||||
|
||||
if (seek_by_bytes < 0)
|
||||
seek_by_bytes = !!(ic->iformat->flags & AVFMT_TS_DISCONT) && strcmp("ogg", ic->iformat->name);
|
||||
@@ -3013,7 +3013,7 @@ static int read_thread(void *arg)
|
||||
}
|
||||
ret = av_read_frame(ic, pkt);
|
||||
if (ret < 0) {
|
||||
if (ret == AVERROR_EOF || avio_feof(ic->pb))
|
||||
if (ret == AVERROR_EOF || url_feof(ic->pb))
|
||||
eof = 1;
|
||||
if (ic->pb && ic->pb->error)
|
||||
break;
|
||||
|
62
ffprobe.c
62
ffprobe.c
@@ -33,7 +33,6 @@
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/bprint.h"
|
||||
#include "libavutil/hash.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "libavutil/dict.h"
|
||||
@@ -81,7 +80,6 @@ static int show_private_data = 1;
|
||||
|
||||
static char *print_format;
|
||||
static char *stream_specifier;
|
||||
static char *show_data_hash;
|
||||
|
||||
typedef struct {
|
||||
int id; ///< identifier
|
||||
@@ -125,8 +123,6 @@ typedef enum {
|
||||
SECTION_ID_FRAME,
|
||||
SECTION_ID_FRAMES,
|
||||
SECTION_ID_FRAME_TAGS,
|
||||
SECTION_ID_FRAME_SIDE_DATA_LIST,
|
||||
SECTION_ID_FRAME_SIDE_DATA,
|
||||
SECTION_ID_LIBRARY_VERSION,
|
||||
SECTION_ID_LIBRARY_VERSIONS,
|
||||
SECTION_ID_PACKET,
|
||||
@@ -156,10 +152,8 @@ static struct section sections[] = {
|
||||
[SECTION_ID_FORMAT] = { SECTION_ID_FORMAT, "format", 0, { SECTION_ID_FORMAT_TAGS, -1 } },
|
||||
[SECTION_ID_FORMAT_TAGS] = { SECTION_ID_FORMAT_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "format_tags" },
|
||||
[SECTION_ID_FRAMES] = { SECTION_ID_FRAMES, "frames", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME, SECTION_ID_SUBTITLE, -1 } },
|
||||
[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDE_DATA_LIST, -1 } },
|
||||
[SECTION_ID_FRAME] = { SECTION_ID_FRAME, "frame", 0, { SECTION_ID_FRAME_TAGS, -1 } },
|
||||
[SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "frame_tags" },
|
||||
[SECTION_ID_FRAME_SIDE_DATA_LIST] ={ SECTION_ID_FRAME_SIDE_DATA_LIST, "side_data_list", SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDE_DATA, -1 } },
|
||||
[SECTION_ID_FRAME_SIDE_DATA] = { SECTION_ID_FRAME_SIDE_DATA, "side_data", 0, { -1 } },
|
||||
[SECTION_ID_LIBRARY_VERSIONS] = { SECTION_ID_LIBRARY_VERSIONS, "library_versions", SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } },
|
||||
[SECTION_ID_LIBRARY_VERSION] = { SECTION_ID_LIBRARY_VERSION, "library_version", 0, { -1 } },
|
||||
[SECTION_ID_PACKETS] = { SECTION_ID_PACKETS, "packets", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} },
|
||||
@@ -189,8 +183,6 @@ static const OptionDef *options;
|
||||
static const char *input_filename;
|
||||
static AVInputFormat *iformat = NULL;
|
||||
|
||||
static struct AVHashContext *hash;
|
||||
|
||||
static const char *const binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" };
|
||||
static const char *const decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P" };
|
||||
|
||||
@@ -689,21 +681,6 @@ static void writer_print_data(WriterContext *wctx, const char *name,
|
||||
av_bprint_finalize(&bp, NULL);
|
||||
}
|
||||
|
||||
static void writer_print_data_hash(WriterContext *wctx, const char *name,
|
||||
uint8_t *data, int size)
|
||||
{
|
||||
char *p, buf[AV_HASH_MAX_SIZE * 2 + 64] = { 0 };
|
||||
|
||||
if (!hash)
|
||||
return;
|
||||
av_hash_init(hash);
|
||||
av_hash_update(hash, data, size);
|
||||
snprintf(buf, sizeof(buf), "%s:", av_hash_get_name(hash));
|
||||
p = buf + strlen(buf);
|
||||
av_hash_final_hex(hash, p, buf + sizeof(buf) - p);
|
||||
writer_print_string(wctx, name, buf, 0);
|
||||
}
|
||||
|
||||
#define MAX_REGISTERED_WRITERS_NB 64
|
||||
|
||||
static const Writer *registered_writers[MAX_REGISTERED_WRITERS_NB + 1];
|
||||
@@ -1711,7 +1688,6 @@ static void show_packet(WriterContext *w, AVFormatContext *fmt_ctx, AVPacket *pk
|
||||
print_fmt("flags", "%c", pkt->flags & AV_PKT_FLAG_KEY ? 'K' : '_');
|
||||
if (do_show_data)
|
||||
writer_print_data(w, "data", pkt->data, pkt->size);
|
||||
writer_print_data_hash(w, "data_hash", pkt->data, pkt->size);
|
||||
writer_print_section_footer(w);
|
||||
|
||||
av_bprint_finalize(&pbuf, NULL);
|
||||
@@ -1746,7 +1722,6 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
{
|
||||
AVBPrint pbuf;
|
||||
const char *s;
|
||||
int i;
|
||||
|
||||
av_bprint_init(&pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
|
||||
|
||||
@@ -1809,20 +1784,6 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
|
||||
}
|
||||
if (do_show_frame_tags)
|
||||
show_tags(w, av_frame_get_metadata(frame), SECTION_ID_FRAME_TAGS);
|
||||
if (frame->nb_side_data) {
|
||||
writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA_LIST);
|
||||
for (i = 0; i < frame->nb_side_data; i++) {
|
||||
AVFrameSideData *sd = frame->side_data[i];
|
||||
const char *name;
|
||||
|
||||
writer_print_section_header(w, SECTION_ID_FRAME_SIDE_DATA);
|
||||
name = av_frame_side_data_name(sd->type);
|
||||
print_str("side_data_type", name ? name : "unknown");
|
||||
print_int("side_data_size", sd->size);
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
|
||||
writer_print_section_footer(w);
|
||||
|
||||
@@ -2170,8 +2131,6 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
else print_str_opt("bit_rate", "N/A");
|
||||
if (dec_ctx->rc_max_rate > 0) print_val ("max_bit_rate", dec_ctx->rc_max_rate, unit_bit_per_second_str);
|
||||
else print_str_opt("max_bit_rate", "N/A");
|
||||
if (dec_ctx->bits_per_raw_sample > 0) print_fmt("bits_per_raw_sample", "%d", dec_ctx->bits_per_raw_sample);
|
||||
else print_str_opt("bits_per_raw_sample", "N/A");
|
||||
if (stream->nb_frames) print_fmt ("nb_frames", "%"PRId64, stream->nb_frames);
|
||||
else print_str_opt("nb_frames", "N/A");
|
||||
if (nb_streams_frames[stream_idx]) print_fmt ("nb_read_frames", "%"PRIu64, nb_streams_frames[stream_idx]);
|
||||
@@ -2181,8 +2140,6 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
if (do_show_data)
|
||||
writer_print_data(w, "extradata", dec_ctx->extradata,
|
||||
dec_ctx->extradata_size);
|
||||
writer_print_data_hash(w, "extradata_hash", dec_ctx->extradata,
|
||||
dec_ctx->extradata_size);
|
||||
|
||||
/* Print disposition information */
|
||||
#define PRINT_DISPOSITION(flagname, name) do { \
|
||||
@@ -2911,7 +2868,6 @@ static const OptionDef real_options[] = {
|
||||
{ "select_streams", OPT_STRING | HAS_ARG, {(void*)&stream_specifier}, "select the specified streams", "stream_specifier" },
|
||||
{ "sections", OPT_EXIT, {.func_arg = opt_sections}, "print sections structure and section information, and exit" },
|
||||
{ "show_data", OPT_BOOL, {(void*)&do_show_data}, "show packets data" },
|
||||
{ "show_data_hash", OPT_STRING | HAS_ARG, {(void*)&show_data_hash}, "show packets data hash" },
|
||||
{ "show_error", 0, {(void*)&opt_show_error}, "show probing error" },
|
||||
{ "show_format", 0, {(void*)&opt_show_format}, "show format/container info" },
|
||||
{ "show_frames", 0, {(void*)&opt_show_frames}, "show frames info" },
|
||||
@@ -3015,21 +2971,6 @@ int main(int argc, char **argv)
|
||||
w_name = av_strtok(print_format, "=", &buf);
|
||||
w_args = buf;
|
||||
|
||||
if (show_data_hash) {
|
||||
if ((ret = av_hash_alloc(&hash, show_data_hash)) < 0) {
|
||||
if (ret == AVERROR(EINVAL)) {
|
||||
const char *n;
|
||||
av_log(NULL, AV_LOG_ERROR,
|
||||
"Unknown hash algorithm '%s'\nKnown algorithms:",
|
||||
show_data_hash);
|
||||
for (i = 0; (n = av_hash_names(i)); i++)
|
||||
av_log(NULL, AV_LOG_ERROR, " %s", n);
|
||||
av_log(NULL, AV_LOG_ERROR, "\n");
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
w = writer_get_by_name(w_name);
|
||||
if (!w) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Unknown output format with name '%s'\n", w_name);
|
||||
@@ -3069,7 +3010,6 @@ int main(int argc, char **argv)
|
||||
end:
|
||||
av_freep(&print_format);
|
||||
av_freep(&read_intervals);
|
||||
av_hash_freep(&hash);
|
||||
|
||||
uninit_opts();
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(sections); i++)
|
||||
|
85
ffserver.c
85
ffserver.c
@@ -91,7 +91,7 @@ enum HTTPState {
|
||||
RTSPSTATE_SEND_PACKET,
|
||||
};
|
||||
|
||||
static const char * const http_state[] = {
|
||||
static const char *http_state[] = {
|
||||
"HTTP_WAIT_REQUEST",
|
||||
"HTTP_SEND_HEADER",
|
||||
|
||||
@@ -592,7 +592,7 @@ static void start_multicast(void)
|
||||
int default_port, stream_index;
|
||||
|
||||
default_port = 6000;
|
||||
for(stream = first_stream; stream; stream = stream->next) {
|
||||
for(stream = first_stream; stream != NULL; stream = stream->next) {
|
||||
if (stream->is_multicast) {
|
||||
unsigned random0 = av_lfg_get(&random_state);
|
||||
unsigned random1 = av_lfg_get(&random_state);
|
||||
@@ -646,7 +646,7 @@ static int http_server(void)
|
||||
struct pollfd *poll_table, *poll_entry;
|
||||
HTTPContext *c, *c_next;
|
||||
|
||||
if(!(poll_table = av_mallocz_array(nb_max_http_connections + 2, sizeof(*poll_table)))) {
|
||||
if(!(poll_table = av_mallocz((nb_max_http_connections + 2)*sizeof(*poll_table)))) {
|
||||
http_log("Impossible to allocate a poll table handling %d connections.\n", nb_max_http_connections);
|
||||
return -1;
|
||||
}
|
||||
@@ -696,7 +696,7 @@ static int http_server(void)
|
||||
/* wait for events on each HTTP handle */
|
||||
c = first_http_ctx;
|
||||
delay = 1000;
|
||||
while (c) {
|
||||
while (c != NULL) {
|
||||
int fd;
|
||||
fd = c->fd;
|
||||
switch(c->state) {
|
||||
@@ -763,7 +763,7 @@ static int http_server(void)
|
||||
}
|
||||
|
||||
/* now handle the events */
|
||||
for(c = first_http_ctx; c; c = c_next) {
|
||||
for(c = first_http_ctx; c != NULL; c = c_next) {
|
||||
c_next = c->next;
|
||||
if (handle_connection(c) < 0) {
|
||||
log_connection(c);
|
||||
@@ -881,7 +881,7 @@ static void close_connection(HTTPContext *c)
|
||||
|
||||
/* remove connection from list */
|
||||
cp = &first_http_ctx;
|
||||
while (*cp) {
|
||||
while ((*cp) != NULL) {
|
||||
c1 = *cp;
|
||||
if (c1 == c)
|
||||
*cp = c->next;
|
||||
@@ -890,7 +890,7 @@ static void close_connection(HTTPContext *c)
|
||||
}
|
||||
|
||||
/* remove references, if any (XXX: do it faster) */
|
||||
for(c1 = first_http_ctx; c1; c1 = c1->next) {
|
||||
for(c1 = first_http_ctx; c1 != NULL; c1 = c1->next) {
|
||||
if (c1->rtsp_c == c)
|
||||
c1->rtsp_c = NULL;
|
||||
}
|
||||
@@ -1258,13 +1258,24 @@ static int modify_current_stream(HTTPContext *c, char *rates)
|
||||
return action_required;
|
||||
}
|
||||
|
||||
/* XXX: factorize in utils.c ? */
|
||||
/* XXX: take care with different space meaning */
|
||||
static void skip_spaces(const char **pp)
|
||||
{
|
||||
const char *p;
|
||||
p = *pp;
|
||||
while (*p == ' ' || *p == '\t')
|
||||
p++;
|
||||
*pp = p;
|
||||
}
|
||||
|
||||
static void get_word(char *buf, int buf_size, const char **pp)
|
||||
{
|
||||
const char *p;
|
||||
char *q;
|
||||
|
||||
p = *pp;
|
||||
p += strspn(p, SPACE_CHARS);
|
||||
skip_spaces(&p);
|
||||
q = buf;
|
||||
while (!av_isspace(*p) && *p != '\0') {
|
||||
if ((q - buf) < buf_size - 1)
|
||||
@@ -1475,7 +1486,7 @@ static void compute_real_filename(char *filename, int max_size)
|
||||
p = strrchr(file1, '.');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
for(stream = first_stream; stream; stream = stream->next) {
|
||||
for(stream = first_stream; stream != NULL; stream = stream->next) {
|
||||
av_strlcpy(file2, stream->filename, sizeof(file2));
|
||||
p = strrchr(file2, '.');
|
||||
if (p)
|
||||
@@ -1584,12 +1595,12 @@ static int http_parse_request(HTTPContext *c)
|
||||
av_strlcpy(filename, "index.html", sizeof(filename) - 1);
|
||||
|
||||
stream = first_stream;
|
||||
while (stream) {
|
||||
while (stream != NULL) {
|
||||
if (!strcmp(stream->filename, filename) && validate_acl(stream, c))
|
||||
break;
|
||||
stream = stream->next;
|
||||
}
|
||||
if (!stream) {
|
||||
if (stream == NULL) {
|
||||
snprintf(msg, sizeof(msg), "File '%s' not found", url);
|
||||
http_log("File '%s' not found\n", url);
|
||||
goto send_error;
|
||||
@@ -1963,7 +1974,7 @@ static void compute_status(HTTPContext *c)
|
||||
avio_printf(pb, "<table cellspacing=0 cellpadding=4>\n");
|
||||
avio_printf(pb, "<tr><th valign=top>Path<th align=left>Served<br>Conns<th><br>bytes<th valign=top>Format<th>Bit rate<br>kbits/s<th align=left>Video<br>kbits/s<th><br>Codec<th align=left>Audio<br>kbits/s<th><br>Codec<th align=left valign=top>Feed\n");
|
||||
stream = first_stream;
|
||||
while (stream) {
|
||||
while (stream != NULL) {
|
||||
char sfilename[1024];
|
||||
char *eosf;
|
||||
|
||||
@@ -2052,7 +2063,7 @@ static void compute_status(HTTPContext *c)
|
||||
avio_printf(pb, "</table>\n");
|
||||
|
||||
stream = first_stream;
|
||||
while (stream) {
|
||||
while (stream != NULL) {
|
||||
if (stream->feed == stream) {
|
||||
avio_printf(pb, "<h2>Feed %s</h2>", stream->filename);
|
||||
if (stream->pid) {
|
||||
@@ -2130,7 +2141,7 @@ static void compute_status(HTTPContext *c)
|
||||
avio_printf(pb, "<tr><th>#<th>File<th>IP<th>Proto<th>State<th>Target bits/sec<th>Actual bits/sec<th>Bytes transferred\n");
|
||||
c1 = first_http_ctx;
|
||||
i = 0;
|
||||
while (c1) {
|
||||
while (c1 != NULL) {
|
||||
int bitrate;
|
||||
int j;
|
||||
|
||||
@@ -2286,7 +2297,7 @@ static int http_prepare_data(HTTPContext *c)
|
||||
c->fmt_ctx = *ctx;
|
||||
av_freep(&ctx);
|
||||
av_dict_copy(&(c->fmt_ctx.metadata), c->stream->metadata, 0);
|
||||
c->fmt_ctx.streams = av_mallocz_array(c->stream->nb_streams, sizeof(AVStream *));
|
||||
c->fmt_ctx.streams = av_mallocz(sizeof(AVStream *) * c->stream->nb_streams);
|
||||
|
||||
for(i=0;i<c->stream->nb_streams;i++) {
|
||||
AVStream *src;
|
||||
@@ -2774,7 +2785,7 @@ static int http_receive_data(HTTPContext *c)
|
||||
}
|
||||
|
||||
/* wake up any waiting connections */
|
||||
for(c1 = first_http_ctx; c1; c1 = c1->next) {
|
||||
for(c1 = first_http_ctx; c1 != NULL; c1 = c1->next) {
|
||||
if (c1->state == HTTPSTATE_WAIT_FEED &&
|
||||
c1->stream->feed == c->stream->feed)
|
||||
c1->state = HTTPSTATE_SEND_DATA;
|
||||
@@ -2830,7 +2841,7 @@ static int http_receive_data(HTTPContext *c)
|
||||
c->stream->feed_opened = 0;
|
||||
close(c->feed_fd);
|
||||
/* wake up any waiting connections to stop waiting for feed */
|
||||
for(c1 = first_http_ctx; c1; c1 = c1->next) {
|
||||
for(c1 = first_http_ctx; c1 != NULL; c1 = c1->next) {
|
||||
if (c1->state == HTTPSTATE_WAIT_FEED &&
|
||||
c1->stream->feed == c->stream->feed)
|
||||
c1->state = HTTPSTATE_SEND_DATA_TRAILER;
|
||||
@@ -2966,10 +2977,8 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
|
||||
AVDictionaryEntry *entry = av_dict_get(stream->metadata, "title", NULL, 0);
|
||||
int i;
|
||||
|
||||
*pbuffer = NULL;
|
||||
|
||||
avc = avformat_alloc_context();
|
||||
if (!avc || !rtp_format) {
|
||||
if (avc == NULL || !rtp_format) {
|
||||
return -1;
|
||||
}
|
||||
avc->oformat = rtp_format;
|
||||
@@ -3004,7 +3013,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
|
||||
av_free(avc);
|
||||
av_free(avs);
|
||||
|
||||
return *pbuffer ? strlen(*pbuffer) : AVERROR(ENOMEM);
|
||||
return strlen(*pbuffer);
|
||||
}
|
||||
|
||||
static void rtsp_cmd_options(HTTPContext *c, const char *url)
|
||||
@@ -3032,7 +3041,7 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url)
|
||||
if (*path == '/')
|
||||
path++;
|
||||
|
||||
for(stream = first_stream; stream; stream = stream->next) {
|
||||
for(stream = first_stream; stream != NULL; stream = stream->next) {
|
||||
if (!stream->is_feed &&
|
||||
stream->fmt && !strcmp(stream->fmt->name, "rtp") &&
|
||||
!strcmp(path, stream->filename)) {
|
||||
@@ -3040,7 +3049,7 @@ static void rtsp_cmd_describe(HTTPContext *c, const char *url)
|
||||
}
|
||||
}
|
||||
/* no stream found */
|
||||
rtsp_reply_error(c, RTSP_STATUS_NOT_FOUND);
|
||||
rtsp_reply_error(c, RTSP_STATUS_SERVICE); /* XXX: right error ? */
|
||||
return;
|
||||
|
||||
found:
|
||||
@@ -3070,7 +3079,7 @@ static HTTPContext *find_rtp_session(const char *session_id)
|
||||
if (session_id[0] == '\0')
|
||||
return NULL;
|
||||
|
||||
for(c = first_http_ctx; c; c = c->next) {
|
||||
for(c = first_http_ctx; c != NULL; c = c->next) {
|
||||
if (!strcmp(c->session_id, session_id))
|
||||
return c;
|
||||
}
|
||||
@@ -3110,7 +3119,7 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url,
|
||||
path++;
|
||||
|
||||
/* now check each stream */
|
||||
for(stream = first_stream; stream; stream = stream->next) {
|
||||
for(stream = first_stream; stream != NULL; stream = stream->next) {
|
||||
if (!stream->is_feed &&
|
||||
stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
|
||||
/* accept aggregate filenames only if single stream */
|
||||
@@ -3416,7 +3425,7 @@ static int rtp_new_av_stream(HTTPContext *c,
|
||||
if (!st)
|
||||
goto fail;
|
||||
ctx->nb_streams = 1;
|
||||
ctx->streams = av_mallocz_array(ctx->nb_streams, sizeof(AVStream *));
|
||||
ctx->streams = av_mallocz(sizeof(AVStream *) * ctx->nb_streams);
|
||||
if (!ctx->streams)
|
||||
goto fail;
|
||||
ctx->streams[0] = st;
|
||||
@@ -3571,7 +3580,7 @@ static void remove_stream(FFStream *stream)
|
||||
{
|
||||
FFStream **ps;
|
||||
ps = &first_stream;
|
||||
while (*ps) {
|
||||
while (*ps != NULL) {
|
||||
if (*ps == stream)
|
||||
*ps = (*ps)->next;
|
||||
else
|
||||
@@ -3637,7 +3646,7 @@ static void build_file_streams(void)
|
||||
int i, ret;
|
||||
|
||||
/* gather all streams */
|
||||
for(stream = first_stream; stream; stream = stream_next) {
|
||||
for(stream = first_stream; stream != NULL; stream = stream_next) {
|
||||
AVFormatContext *infile = NULL;
|
||||
stream_next = stream->next;
|
||||
if (stream->stream_type == STREAM_TYPE_LIVE &&
|
||||
@@ -3689,7 +3698,7 @@ static void build_feed_streams(void)
|
||||
int i;
|
||||
|
||||
/* gather all streams */
|
||||
for(stream = first_stream; stream; stream = stream->next) {
|
||||
for(stream = first_stream; stream != NULL; stream = stream->next) {
|
||||
feed = stream->feed;
|
||||
if (feed) {
|
||||
if (stream->is_feed) {
|
||||
@@ -3704,7 +3713,7 @@ static void build_feed_streams(void)
|
||||
}
|
||||
|
||||
/* create feed files if needed */
|
||||
for(feed = first_feed; feed; feed = feed->next_feed) {
|
||||
for(feed = first_feed; feed != NULL; feed = feed->next_feed) {
|
||||
int fd;
|
||||
|
||||
if (avio_check(feed->feed_filename, AVIO_FLAG_READ) > 0) {
|
||||
@@ -3836,7 +3845,7 @@ static void compute_bandwidth(void)
|
||||
int i;
|
||||
FFStream *stream;
|
||||
|
||||
for(stream = first_stream; stream; stream = stream->next) {
|
||||
for(stream = first_stream; stream != NULL; stream = stream->next) {
|
||||
bandwidth = 0;
|
||||
for(i=0;i<stream->nb_streams;i++) {
|
||||
AVStream *st = stream->streams[i];
|
||||
@@ -4070,20 +4079,14 @@ static int parse_ffconfig(const char *filename)
|
||||
|
||||
get_arg(cmd, sizeof(cmd), &p);
|
||||
|
||||
if (!av_strcasecmp(cmd, "Port") || !av_strcasecmp(cmd, "HTTPPort")) {
|
||||
if (!av_strcasecmp(cmd, "Port"))
|
||||
WARNING("Port option is deprecated, use HTTPPort instead\n");
|
||||
if (!av_strcasecmp(cmd, "Port")) {
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
val = atoi(arg);
|
||||
if (val < 1 || val > 65536) {
|
||||
ERROR("Invalid port: %s\n", arg);
|
||||
ERROR("Invalid_port: %s\n", arg);
|
||||
}
|
||||
if (val < 1024)
|
||||
WARNING("Trying to use IETF assigned system port: %d\n", val);
|
||||
my_http_addr.sin_port = htons(val);
|
||||
} else if (!av_strcasecmp(cmd, "HTTPBindAddress") || !av_strcasecmp(cmd, "BindAddress")) {
|
||||
if (!av_strcasecmp(cmd, "BindAddress"))
|
||||
WARNING("BindAddress option is deprecated, use HTTPBindAddress instead\n");
|
||||
} else if (!av_strcasecmp(cmd, "BindAddress")) {
|
||||
get_arg(arg, sizeof(arg), &p);
|
||||
if (resolve_host(&my_http_addr.sin_addr, arg) != 0) {
|
||||
ERROR("%s:%d: Invalid host/IP address: %s\n", arg);
|
||||
@@ -4289,7 +4292,7 @@ static int parse_ffconfig(const char *filename)
|
||||
FFStream *sfeed;
|
||||
|
||||
sfeed = first_feed;
|
||||
while (sfeed) {
|
||||
while (sfeed != NULL) {
|
||||
if (!strcmp(sfeed->filename, arg))
|
||||
break;
|
||||
sfeed = sfeed->next_feed;
|
||||
|
@@ -38,15 +38,15 @@ static av_cold int zero12v_decode_init(AVCodecContext *avctx)
|
||||
static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame, AVPacket *avpkt)
|
||||
{
|
||||
int line, ret;
|
||||
int line = 0, ret;
|
||||
const int width = avctx->width;
|
||||
AVFrame *pic = data;
|
||||
uint16_t *y, *u, *v;
|
||||
const uint8_t *line_end, *src = avpkt->data;
|
||||
int stride = avctx->width * 8 / 3;
|
||||
|
||||
if (width <= 1 || avctx->height <= 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Dimensions %dx%d not supported.\n", width, avctx->height);
|
||||
if (width == 1) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -67,45 +67,45 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
pic->pict_type = AV_PICTURE_TYPE_I;
|
||||
pic->key_frame = 1;
|
||||
|
||||
y = (uint16_t *)pic->data[0];
|
||||
u = (uint16_t *)pic->data[1];
|
||||
v = (uint16_t *)pic->data[2];
|
||||
line_end = avpkt->data + stride;
|
||||
for (line = 0; line < avctx->height; line++) {
|
||||
uint16_t y_temp[6] = {0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000};
|
||||
uint16_t u_temp[3] = {0x8000, 0x8000, 0x8000};
|
||||
uint16_t v_temp[3] = {0x8000, 0x8000, 0x8000};
|
||||
int x;
|
||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
|
||||
for (x = 0; x < width; x += 6) {
|
||||
uint32_t t;
|
||||
|
||||
if (width - x < 6 || line_end - src < 16) {
|
||||
y = y_temp;
|
||||
u = u_temp;
|
||||
v = v_temp;
|
||||
}
|
||||
|
||||
if (line_end - src < 4)
|
||||
break;
|
||||
|
||||
t = AV_RL32(src);
|
||||
while (line++ < avctx->height) {
|
||||
while (1) {
|
||||
uint32_t t = AV_RL32(src);
|
||||
src += 4;
|
||||
*u++ = t << 6 & 0xFFC0;
|
||||
*y++ = t >> 4 & 0xFFC0;
|
||||
*v++ = t >> 14 & 0xFFC0;
|
||||
|
||||
if (line_end - src < 4)
|
||||
if (src >= line_end - 1) {
|
||||
*y = 0x80;
|
||||
src++;
|
||||
line_end += stride;
|
||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
break;
|
||||
}
|
||||
|
||||
t = AV_RL32(src);
|
||||
src += 4;
|
||||
*y++ = t << 6 & 0xFFC0;
|
||||
*u++ = t >> 4 & 0xFFC0;
|
||||
*y++ = t >> 14 & 0xFFC0;
|
||||
|
||||
if (line_end - src < 4)
|
||||
if (src >= line_end - 2) {
|
||||
if (!(width & 1)) {
|
||||
*y = 0x80;
|
||||
src += 2;
|
||||
}
|
||||
line_end += stride;
|
||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
break;
|
||||
}
|
||||
|
||||
t = AV_RL32(src);
|
||||
src += 4;
|
||||
@@ -113,8 +113,15 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
*y++ = t >> 4 & 0xFFC0;
|
||||
*u++ = t >> 14 & 0xFFC0;
|
||||
|
||||
if (line_end - src < 4)
|
||||
if (src >= line_end - 1) {
|
||||
*y = 0x80;
|
||||
src++;
|
||||
line_end += stride;
|
||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
break;
|
||||
}
|
||||
|
||||
t = AV_RL32(src);
|
||||
src += 4;
|
||||
@@ -122,21 +129,18 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
*v++ = t >> 4 & 0xFFC0;
|
||||
*y++ = t >> 14 & 0xFFC0;
|
||||
|
||||
if (width - x < 6)
|
||||
if (src >= line_end - 2) {
|
||||
if (width & 1) {
|
||||
*y = 0x80;
|
||||
src += 2;
|
||||
}
|
||||
line_end += stride;
|
||||
y = (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (x < width) {
|
||||
y = x + (uint16_t *)(pic->data[0] + line * pic->linesize[0]);
|
||||
u = x/2 + (uint16_t *)(pic->data[1] + line * pic->linesize[1]);
|
||||
v = x/2 + (uint16_t *)(pic->data[2] + line * pic->linesize[2]);
|
||||
memcpy(y, y_temp, sizeof(*y) * (width - x));
|
||||
memcpy(u, u_temp, sizeof(*u) * (width - x + 1) / 2);
|
||||
memcpy(v, v_temp, sizeof(*v) * (width - x + 1) / 2);
|
||||
}
|
||||
|
||||
line_end += stride;
|
||||
src = line_end - stride;
|
||||
}
|
||||
|
||||
*got_frame = 1;
|
||||
|
@@ -101,7 +101,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
if (avpkt->size < (hdr_size + 1) * avctx->channels) {
|
||||
av_log(avctx, AV_LOG_ERROR, "packet size is too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
esc->fib_acc[0] = avpkt->data[1] + 128;
|
||||
@@ -124,7 +124,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
if (!esc->data[0]) {
|
||||
av_log(avctx, AV_LOG_ERROR, "unexpected empty packet\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
/* decode next piece of data from the buffer */
|
||||
|
@@ -15,7 +15,6 @@ HEADERS = avcodec.h \
|
||||
|
||||
OBJS = allcodecs.o \
|
||||
audioconvert.o \
|
||||
avdct.o \
|
||||
avpacket.o \
|
||||
avpicture.o \
|
||||
bitstream.o \
|
||||
@@ -32,7 +31,7 @@ OBJS = allcodecs.o \
|
||||
resample2.o \
|
||||
utils.o \
|
||||
|
||||
# subsystems
|
||||
# parts needed for many different codecs
|
||||
OBJS-$(CONFIG_AANDCTTABLES) += aandcttab.o
|
||||
OBJS-$(CONFIG_AC3DSP) += ac3dsp.o
|
||||
OBJS-$(CONFIG_AUDIO_FRAME_QUEUE) += audio_frame_queue.o
|
||||
@@ -42,11 +41,12 @@ OBJS-$(CONFIG_BSWAPDSP) += bswapdsp.o
|
||||
OBJS-$(CONFIG_CABAC) += cabac.o
|
||||
OBJS-$(CONFIG_CRYSTALHD) += crystalhd.o
|
||||
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
|
||||
OBJS-$(CONFIG_DSPUTIL) += dsputil.o
|
||||
OBJS-$(CONFIG_DXVA2) += dxva2.o
|
||||
OBJS-$(CONFIG_ERROR_RESILIENCE) += error_resilience.o
|
||||
OBJS-$(CONFIG_EXIF) += exif.o tiff_common.o
|
||||
OBJS-$(CONFIG_FAANDCT) += faandct.o
|
||||
OBJS-$(CONFIG_FAANIDCT) += faanidct.o
|
||||
OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o jfdctfst.o jfdctint.o
|
||||
OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o faandct.o \
|
||||
jfdctfst.o jfdctint.o
|
||||
FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o cos_fixed_tables.o
|
||||
OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
|
||||
fft_fixed_32.o fft_init_table.o \
|
||||
@@ -54,15 +54,15 @@ OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \
|
||||
OBJS-$(CONFIG_GOLOMB) += golomb.o
|
||||
OBJS-$(CONFIG_H263DSP) += h263dsp.o
|
||||
OBJS-$(CONFIG_H264CHROMA) += h264chroma.o
|
||||
OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o
|
||||
OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o startcode.o
|
||||
OBJS-$(CONFIG_H264PRED) += h264pred.o
|
||||
OBJS-$(CONFIG_H264QPEL) += h264qpel.o
|
||||
OBJS-$(CONFIG_HPELDSP) += hpeldsp.o
|
||||
OBJS-$(CONFIG_HUFFMAN) += huffman.o
|
||||
OBJS-$(CONFIG_HUFFYUVDSP) += huffyuvdsp.o
|
||||
OBJS-$(CONFIG_HUFFYUVENCDSP) += huffyuvencdsp.o
|
||||
OBJS-$(CONFIG_IDCTDSP) += idctdsp.o simple_idct.o jrevdct.o
|
||||
OBJS-$(CONFIG_IIRFILTER) += iirfilter.o
|
||||
OBJS-$(CONFIG_IDCTDSP) += idctdsp.o faanidct.o \
|
||||
simple_idct.o jrevdct.o
|
||||
OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o
|
||||
OBJS-$(CONFIG_LIBXVID) += libxvid_rc.o
|
||||
OBJS-$(CONFIG_LLAUDDSP) += lossless_audiodsp.o
|
||||
@@ -70,7 +70,6 @@ OBJS-$(CONFIG_LLVIDDSP) += lossless_videodsp.o
|
||||
OBJS-$(CONFIG_LPC) += lpc.o
|
||||
OBJS-$(CONFIG_LSP) += lsp.o
|
||||
OBJS-$(CONFIG_MDCT) += mdct_fixed.o mdct_float.o mdct_fixed_32.o
|
||||
OBJS-$(CONFIG_ME_CMP) += me_cmp.o dsputil_compat.o
|
||||
OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o mpegaudiodata.o \
|
||||
mpegaudiodecheader.o
|
||||
@@ -90,11 +89,12 @@ RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
|
||||
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
|
||||
OBJS-$(CONFIG_SHARED) += log2_tab.o
|
||||
OBJS-$(CONFIG_SINEWIN) += sinewin.o
|
||||
OBJS-$(CONFIG_STARTCODE) += startcode.o
|
||||
OBJS-$(CONFIG_TPELDSP) += tpeldsp.o
|
||||
OBJS-$(CONFIG_VAAPI) += vaapi.o
|
||||
OBJS-$(CONFIG_VDA) += vda.o
|
||||
OBJS-$(CONFIG_VDPAU) += vdpau.o
|
||||
OBJS-$(CONFIG_VIDEODSP) += videodsp.o
|
||||
OBJS-$(CONFIG_VP3DSP) += vp3dsp.o
|
||||
OBJS-$(CONFIG_WMA_FREQS) += wma_freqs.o
|
||||
|
||||
# decoders/encoders
|
||||
OBJS-$(CONFIG_ZERO12V_DECODER) += 012v.o
|
||||
@@ -105,7 +105,8 @@ OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps.o \
|
||||
sbrdsp.o aacpsdsp.o
|
||||
OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
|
||||
aacpsy.o aactab.o \
|
||||
psymodel.o mpeg4audio.o kbdwin.o
|
||||
psymodel.o iirfilter.o \
|
||||
mpeg4audio.o kbdwin.o
|
||||
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
|
||||
OBJS-$(CONFIG_AC3_DECODER) += ac3dec_float.o ac3dec_data.o ac3.o kbdwin.o
|
||||
OBJS-$(CONFIG_AC3_FIXED_DECODER) += ac3dec_fixed.o ac3dec_data.o ac3.o kbdwin.o
|
||||
@@ -158,8 +159,8 @@ OBJS-$(CONFIG_AYUV_ENCODER) += v408enc.o
|
||||
OBJS-$(CONFIG_BETHSOFTVID_DECODER) += bethsoftvideo.o
|
||||
OBJS-$(CONFIG_BFI_DECODER) += bfi.o
|
||||
OBJS-$(CONFIG_BINK_DECODER) += bink.o binkdsp.o
|
||||
OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER) += binkaudio.o
|
||||
OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER) += binkaudio.o
|
||||
OBJS-$(CONFIG_BINKAUDIO_DCT_DECODER) += binkaudio.o wma.o wma_common.o
|
||||
OBJS-$(CONFIG_BINKAUDIO_RDFT_DECODER) += binkaudio.o wma.o wma_common.o
|
||||
OBJS-$(CONFIG_BINTEXT_DECODER) += bintext.o cga_data.o
|
||||
OBJS-$(CONFIG_BMP_DECODER) += bmp.o msrledec.o
|
||||
OBJS-$(CONFIG_BMP_ENCODER) += bmpenc.o
|
||||
@@ -206,7 +207,7 @@ OBJS-$(CONFIG_DVVIDEO_DECODER) += dvdec.o dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DVVIDEO_ENCODER) += dvenc.o dv.o dvdata.o
|
||||
OBJS-$(CONFIG_DXA_DECODER) += dxa.o
|
||||
OBJS-$(CONFIG_DXTORY_DECODER) += dxtory.o
|
||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3_data.o
|
||||
OBJS-$(CONFIG_EAC3_DECODER) += eac3dec.o eac3_data.o
|
||||
OBJS-$(CONFIG_EAC3_ENCODER) += eac3enc.o eac3_data.o
|
||||
OBJS-$(CONFIG_EACMV_DECODER) += eacmv.o
|
||||
OBJS-$(CONFIG_EAMAD_DECODER) += eamad.o eaidct.o mpeg12.o \
|
||||
@@ -317,12 +318,12 @@ OBJS-$(CONFIG_MP3ON4_DECODER) += mpegaudiodec_fixed.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_MP3ON4FLOAT_DECODER) += mpegaudiodec_float.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_MPC7_DECODER) += mpc7.o mpc.o
|
||||
OBJS-$(CONFIG_MPC8_DECODER) += mpc8.o mpc.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO_DECODER) += mpeg12.o mpeg12data.o \
|
||||
mpegvideo.o error_resilience.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG1VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_DECODER) += mpeg12dec.o mpeg12.o mpeg12data.o
|
||||
OBJS-$(CONFIG_MPEG2VIDEO_ENCODER) += mpeg12enc.o mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG4_DECODER) += xvididct.o
|
||||
OBJS-$(CONFIG_MPL2_DECODER) += mpl2dec.o ass.o
|
||||
OBJS-$(CONFIG_MSMPEG4V1_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o
|
||||
@@ -475,7 +476,7 @@ OBJS-$(CONFIG_VB_DECODER) += vb.o
|
||||
OBJS-$(CONFIG_VBLE_DECODER) += vble.o
|
||||
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o \
|
||||
msmpeg4dec.o msmpeg4.o msmpeg4data.o \
|
||||
wmv2dsp.o
|
||||
wmv2dsp.o startcode.o
|
||||
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
|
||||
OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdaudio.o
|
||||
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdvideo.o
|
||||
@@ -498,7 +499,7 @@ OBJS-$(CONFIG_WAVPACK_DECODER) += wavpack.o
|
||||
OBJS-$(CONFIG_WAVPACK_ENCODER) += wavpackenc.o
|
||||
OBJS-$(CONFIG_WEBP_DECODER) += vp8.o vp8dsp.o vp56rac.o
|
||||
OBJS-$(CONFIG_WEBP_DECODER) += webp.o exif.o tiff_common.o
|
||||
OBJS-$(CONFIG_WEBVTT_DECODER) += webvttdec.o ass.o
|
||||
OBJS-$(CONFIG_WEBVTT_DECODER) += webvttdec.o
|
||||
OBJS-$(CONFIG_WEBVTT_ENCODER) += webvttenc.o ass_split.o
|
||||
OBJS-$(CONFIG_WMALOSSLESS_DECODER) += wmalosslessdec.o wma_common.o
|
||||
OBJS-$(CONFIG_WMAPRO_DECODER) += wmaprodec.o wma.o wma_common.o
|
||||
@@ -646,12 +647,7 @@ OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER) += adpcmenc.o adpcm_data.o
|
||||
OBJS-$(CONFIG_VIMA_DECODER) += vima.o adpcm_data.o
|
||||
|
||||
# hardware accelerators
|
||||
OBJS-$(CONFIG_DXVA2) += dxva2.o
|
||||
OBJS-$(CONFIG_VAAPI) += vaapi.o
|
||||
OBJS-$(CONFIG_VDA) += vda.o
|
||||
OBJS-$(CONFIG_VDPAU) += vdpau.o
|
||||
|
||||
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o vaapi_mpeg.o
|
||||
OBJS-$(CONFIG_H263_VDPAU_HWACCEL) += vdpau_mpeg4.o
|
||||
OBJS-$(CONFIG_H264_DXVA2_HWACCEL) += dxva2_h264.o
|
||||
OBJS-$(CONFIG_H264_VAAPI_HWACCEL) += vaapi_h264.o
|
||||
@@ -660,13 +656,13 @@ OBJS-$(CONFIG_H264_VDPAU_HWACCEL) += vdpau_h264.o
|
||||
OBJS-$(CONFIG_MPEG1_VDPAU_HWACCEL) += vdpau_mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG1_XVMC_HWACCEL) += mpegvideo_xvmc.o
|
||||
OBJS-$(CONFIG_MPEG2_DXVA2_HWACCEL) += dxva2_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o
|
||||
OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o vaapi_mpeg.o
|
||||
OBJS-$(CONFIG_MPEG2_VDPAU_HWACCEL) += vdpau_mpeg12.o
|
||||
OBJS-$(CONFIG_MPEG2_XVMC_HWACCEL) += mpegvideo_xvmc.o
|
||||
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o
|
||||
OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o vaapi_mpeg.o
|
||||
OBJS-$(CONFIG_MPEG4_VDPAU_HWACCEL) += vdpau_mpeg4.o
|
||||
OBJS-$(CONFIG_VC1_DXVA2_HWACCEL) += dxva2_vc1.o
|
||||
OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o
|
||||
OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o vaapi_mpeg.o
|
||||
OBJS-$(CONFIG_VC1_VDPAU_HWACCEL) += vdpau_vc1.o
|
||||
|
||||
# libavformat dependencies
|
||||
@@ -709,7 +705,6 @@ OBJS-$(CONFIG_TAK_DEMUXER) += tak.o
|
||||
OBJS-$(CONFIG_WEBM_MUXER) += mpeg4audio.o mpegaudiodata.o \
|
||||
xiph.o flac.o flacdata.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) += vorbis_parser.o xiph.o
|
||||
OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
|
||||
# libavfilter dependencies
|
||||
@@ -721,10 +716,10 @@ OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
|
||||
OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o
|
||||
OBJS-$(CONFIG_LIBFDK_AAC_DECODER) += libfdk-aacdec.o
|
||||
OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o
|
||||
OBJS-$(CONFIG_LIBGSM_DECODER) += libgsmdec.o
|
||||
OBJS-$(CONFIG_LIBGSM_ENCODER) += libgsmenc.o
|
||||
OBJS-$(CONFIG_LIBGSM_MS_DECODER) += libgsmdec.o
|
||||
OBJS-$(CONFIG_LIBGSM_MS_ENCODER) += libgsmenc.o
|
||||
OBJS-$(CONFIG_LIBGSM_DECODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBGSM_ENCODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBGSM_MS_DECODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBGSM_MS_ENCODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBILBC_DECODER) += libilbc.o
|
||||
OBJS-$(CONFIG_LIBILBC_ENCODER) += libilbc.o
|
||||
OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o mpegaudiodecheader.o
|
||||
@@ -808,7 +803,7 @@ OBJS-$(CONFIG_RV40_PARSER) += rv34_parser.o
|
||||
OBJS-$(CONFIG_TAK_PARSER) += tak_parser.o tak.o
|
||||
OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o vc1dsp.o \
|
||||
msmpeg4.o msmpeg4data.o mpeg4video.o \
|
||||
h263.o
|
||||
h263.o startcode.o
|
||||
OBJS-$(CONFIG_VORBIS_PARSER) += vorbis_parser.o xiph.o
|
||||
OBJS-$(CONFIG_VP3_PARSER) += vp3_parser.o
|
||||
OBJS-$(CONFIG_VP8_PARSER) += vp8_parser.o
|
||||
@@ -856,25 +851,24 @@ SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VDA) += vda.h vda_internal.h
|
||||
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h
|
||||
|
||||
TESTPROGS = imgconvert \
|
||||
|
||||
TESTPROGS-$(CONFIG_CABAC) += cabac
|
||||
TESTPROGS-$(CONFIG_FFT) += fft fft-fixed fft-fixed32
|
||||
TESTPROGS-$(CONFIG_IDCTDSP) += dct
|
||||
TESTPROGS-$(CONFIG_IIRFILTER) += iirfilter
|
||||
TESTPROGS-$(HAVE_MMX) += motion
|
||||
TESTPROGS-$(CONFIG_GOLOMB) += golomb
|
||||
TESTPROGS-$(CONFIG_RANGECODER) += rangecoder
|
||||
TESTPROGS-$(CONFIG_SNOW_ENCODER) += snowenc
|
||||
TESTPROGS = cabac \
|
||||
fft \
|
||||
fft-fixed \
|
||||
fft-fixed32 \
|
||||
golomb \
|
||||
iirfilter \
|
||||
imgconvert \
|
||||
rangecoder \
|
||||
snowenc \
|
||||
|
||||
TESTPROGS-$(CONFIG_DCT) += dct
|
||||
TESTPROGS-$(HAVE_MMX) += motion
|
||||
TESTOBJS = dctref.o
|
||||
|
||||
TOOLS = fourcc2pixfmt
|
||||
|
||||
HOSTPROGS = aac_tablegen \
|
||||
aacps_tablegen \
|
||||
aacsbr_tablegen \
|
||||
cabac_tablegen \
|
||||
cbrt_tablegen \
|
||||
cos_tablegen \
|
||||
dsd_tablegen \
|
||||
@@ -902,7 +896,7 @@ else
|
||||
$(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=0
|
||||
endif
|
||||
|
||||
GEN_HEADERS = cabac_tables.h cbrt_tables.h aacps_tables.h aacsbr_tables.h aac_tables.h dsd_tables.h dv_tables.h \
|
||||
GEN_HEADERS = cbrt_tables.h aacps_tables.h aac_tables.h dsd_tables.h dv_tables.h \
|
||||
sinewin_tables.h mpegaudio_tables.h motionpixels_tables.h \
|
||||
pcm_tables.h qdm2_tables.h
|
||||
GEN_HEADERS := $(addprefix $(SUBDIR), $(GEN_HEADERS))
|
||||
@@ -913,9 +907,7 @@ $(GEN_HEADERS): $(SUBDIR)%_tables.h: $(SUBDIR)%_tablegen$(HOSTEXESUF)
|
||||
ifdef CONFIG_HARDCODED_TABLES
|
||||
$(SUBDIR)aacdec.o: $(SUBDIR)cbrt_tables.h
|
||||
$(SUBDIR)aacps.o: $(SUBDIR)aacps_tables.h
|
||||
$(SUBDIR)aacsbr.o: $(SUBDIR)aacsbr_tables.h
|
||||
$(SUBDIR)aactab.o: $(SUBDIR)aac_tables.h
|
||||
$(SUBDIR)cabac.o: $(SUBDIR)cabac_tables.h
|
||||
$(SUBDIR)dsddec.o: $(SUBDIR)dsd_tables.h
|
||||
$(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h
|
||||
$(SUBDIR)sinewin.o: $(SUBDIR)sinewin_tables.h
|
||||
|
@@ -28,7 +28,6 @@
|
||||
#include "a64tables.h"
|
||||
#include "elbg.h"
|
||||
#include "internal.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
|
||||
@@ -66,7 +65,7 @@ static const int mc_colors[5]={0x0,0xb,0xc,0xf,0x1};
|
||||
//static const int mc_colors[5]={0x0,0x8,0xa,0xf,0x7};
|
||||
//static const int mc_colors[5]={0x0,0x9,0x8,0xa,0x3};
|
||||
|
||||
static void to_meta_with_crop(AVCodecContext *avctx, const AVFrame *p, int *dest)
|
||||
static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
|
||||
{
|
||||
int blockx, blocky, x, y;
|
||||
int luma = 0;
|
||||
@@ -79,13 +78,9 @@ static void to_meta_with_crop(AVCodecContext *avctx, const AVFrame *p, int *dest
|
||||
for (y = blocky; y < blocky + 8 && y < C64YRES; y++) {
|
||||
for (x = blockx; x < blockx + 8 && x < C64XRES; x += 2) {
|
||||
if(x < width && y < height) {
|
||||
if (x + 1 < width) {
|
||||
/* build average over 2 pixels */
|
||||
luma = (src[(x + 0 + y * p->linesize[0])] +
|
||||
src[(x + 1 + y * p->linesize[0])]) / 2;
|
||||
} else {
|
||||
luma = src[(x + y * p->linesize[0])];
|
||||
}
|
||||
/* build average over 2 pixels */
|
||||
luma = (src[(x + 0 + y * p->linesize[0])] +
|
||||
src[(x + 1 + y * p->linesize[0])]) / 2;
|
||||
/* write blocks as linear data now so they are suitable for elbg */
|
||||
dest[0] = luma;
|
||||
}
|
||||
@@ -191,11 +186,12 @@ static void render_charset(AVCodecContext *avctx, uint8_t *charset,
|
||||
static av_cold int a64multi_close_encoder(AVCodecContext *avctx)
|
||||
{
|
||||
A64Context *c = avctx->priv_data;
|
||||
av_freep(&c->mc_meta_charset);
|
||||
av_freep(&c->mc_best_cb);
|
||||
av_freep(&c->mc_charset);
|
||||
av_freep(&c->mc_charmap);
|
||||
av_freep(&c->mc_colram);
|
||||
av_frame_free(&avctx->coded_frame);
|
||||
av_free(c->mc_meta_charset);
|
||||
av_free(c->mc_best_cb);
|
||||
av_free(c->mc_charset);
|
||||
av_free(c->mc_charmap);
|
||||
av_free(c->mc_colram);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -224,7 +220,7 @@ static av_cold int a64multi_encode_init(AVCodecContext *avctx)
|
||||
a64_palette[mc_colors[a]][2] * 0.11;
|
||||
}
|
||||
|
||||
if (!(c->mc_meta_charset = av_mallocz_array(c->mc_lifetime, 32000 * sizeof(int))) ||
|
||||
if (!(c->mc_meta_charset = av_malloc_array(c->mc_lifetime, 32000 * sizeof(int))) ||
|
||||
!(c->mc_best_cb = av_malloc(CHARSET_CHARS * 32 * sizeof(int))) ||
|
||||
!(c->mc_charmap = av_mallocz_array(c->mc_lifetime, 1000 * sizeof(int))) ||
|
||||
!(c->mc_colram = av_mallocz(CHARSET_CHARS * sizeof(uint8_t))) ||
|
||||
@@ -242,6 +238,14 @@ static av_cold int a64multi_encode_init(AVCodecContext *avctx)
|
||||
AV_WB32(avctx->extradata, c->mc_lifetime);
|
||||
AV_WB32(avctx->extradata + 16, INTERLACED);
|
||||
|
||||
avctx->coded_frame = av_frame_alloc();
|
||||
if (!avctx->coded_frame) {
|
||||
a64multi_close_encoder(avctx);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
|
||||
avctx->coded_frame->key_frame = 1;
|
||||
if (!avctx->codec_tag)
|
||||
avctx->codec_tag = AV_RL32("a64m");
|
||||
|
||||
@@ -266,9 +270,10 @@ static void a64_compress_colram(unsigned char *buf, int *charmap, uint8_t *colra
|
||||
}
|
||||
|
||||
static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
const AVFrame *p, int *got_packet)
|
||||
const AVFrame *pict, int *got_packet)
|
||||
{
|
||||
A64Context *c = avctx->priv_data;
|
||||
AVFrame *const p = avctx->coded_frame;
|
||||
|
||||
int frame;
|
||||
int x, y;
|
||||
@@ -299,7 +304,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
}
|
||||
|
||||
/* no data, means end encoding asap */
|
||||
if (!p) {
|
||||
if (!pict) {
|
||||
/* all done, end encoding */
|
||||
if (!c->mc_lifetime) return 0;
|
||||
/* no more frames in queue, prepare to flush remaining frames */
|
||||
@@ -312,10 +317,13 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
} else {
|
||||
/* fill up mc_meta_charset with data until lifetime exceeds */
|
||||
if (c->mc_frame_counter < c->mc_lifetime) {
|
||||
*p = *pict;
|
||||
p->pict_type = AV_PICTURE_TYPE_I;
|
||||
p->key_frame = 1;
|
||||
to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter);
|
||||
c->mc_frame_counter++;
|
||||
if (c->next_pts == AV_NOPTS_VALUE)
|
||||
c->next_pts = p->pts;
|
||||
c->next_pts = pict->pts;
|
||||
/* lifetime is not reached so wait for next frame first */
|
||||
return 0;
|
||||
}
|
||||
@@ -326,8 +334,8 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
req_size = 0;
|
||||
/* any frames to encode? */
|
||||
if (c->mc_lifetime) {
|
||||
int alloc_size = charset_size + c->mc_lifetime*(screen_size + colram_size);
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, alloc_size)) < 0)
|
||||
req_size = charset_size + c->mc_lifetime*(screen_size + colram_size);
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, req_size)) < 0)
|
||||
return ret;
|
||||
buf = pkt->data;
|
||||
|
||||
@@ -343,7 +351,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
|
||||
/* advance pointers */
|
||||
buf += charset_size;
|
||||
req_size += charset_size;
|
||||
charset += charset_size;
|
||||
}
|
||||
|
||||
/* write x frames to buf */
|
||||
@@ -380,7 +388,6 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
pkt->pts = pkt->dts = c->next_pts;
|
||||
c->next_pts = AV_NOPTS_VALUE;
|
||||
|
||||
av_assert0(pkt->size >= req_size);
|
||||
pkt->size = req_size;
|
||||
pkt->flags |= AV_PKT_FLAG_KEY;
|
||||
*got_packet = !!req_size;
|
||||
|
@@ -57,7 +57,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
|
||||
|
||||
if (avpriv_aac_parse_header(&gb, &hdr) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error parsing ADTS frame header!\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!hdr.crc_absent && hdr.num_aac_frames > 1) {
|
||||
|
@@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
||||
int size;
|
||||
union {
|
||||
uint64_t u64;
|
||||
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
|
||||
uint8_t u8[8];
|
||||
} tmp;
|
||||
|
||||
tmp.u64 = av_be2ne64(state);
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include "libavutil/mathematics.h"
|
||||
float ff_aac_pow2sf_tab[428];
|
||||
|
||||
av_cold void ff_aac_tableinit(void)
|
||||
void ff_aac_tableinit(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 428; i++)
|
||||
|
@@ -53,7 +53,7 @@ static const uint8_t run_value_bits_short[16] = {
|
||||
3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
|
||||
};
|
||||
|
||||
static const uint8_t * const run_value_bits[2] = {
|
||||
static const uint8_t *run_value_bits[2] = {
|
||||
run_value_bits_long, run_value_bits_short
|
||||
};
|
||||
|
||||
@@ -691,7 +691,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s,
|
||||
}
|
||||
while (idx) {
|
||||
sce->sf_idx[bandaddr[idx]] = minq + q0;
|
||||
minq = FFMAX(paths[idx][minq].prev, 0);
|
||||
minq = paths[idx][minq].prev;
|
||||
idx--;
|
||||
}
|
||||
//set the same quantizers inside window groups
|
||||
@@ -776,6 +776,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
|
||||
do {
|
||||
int prev = -1;
|
||||
tbits = 0;
|
||||
fflag = 0;
|
||||
for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
|
||||
start = w*128;
|
||||
for (g = 0; g < sce->ics.num_swb; g++) {
|
||||
@@ -952,6 +953,7 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
|
||||
}
|
||||
sce->zeroes[w*16+g] = 0;
|
||||
scf = prev_scf = av_clip(SCALE_ONE_POS - SCALE_DIV_512 - log2f(1/maxq[w*16+g])*16/3, 60, 218);
|
||||
step = 16;
|
||||
for (;;) {
|
||||
float dist = 0.0f;
|
||||
int quant_max;
|
||||
|
@@ -425,7 +425,7 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
|
||||
* Save current output configuration if and only if it has been locked.
|
||||
*/
|
||||
static void push_output_configuration(AACContext *ac) {
|
||||
if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {
|
||||
if (ac->oc[1].status == OC_LOCKED) {
|
||||
ac->oc[0] = ac->oc[1];
|
||||
}
|
||||
ac->oc[1].status = OC_NONE;
|
||||
@@ -881,7 +881,7 @@ static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx,
|
||||
if (len == 15 + 255)
|
||||
len += get_bits(gb, 16);
|
||||
if (get_bits_left(gb) < len * 8 + 4) {
|
||||
av_log(avctx, AV_LOG_ERROR, overread_err);
|
||||
av_log(ac->avctx, AV_LOG_ERROR, overread_err);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
skip_bits_long(gb, 8 * len);
|
||||
@@ -3021,12 +3021,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
AV_WL32(side, 2*AV_RL32(side));
|
||||
}
|
||||
|
||||
if (!ac->frame->data[0] && samples) {
|
||||
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
|
||||
err = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
*got_frame_ptr = !!samples;
|
||||
if (samples) {
|
||||
ac->frame->nb_samples = samples;
|
||||
@@ -3096,7 +3090,7 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if (INT_MAX / 8 <= buf_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((err = init_get_bits8(&gb, buf, buf_size)) < 0)
|
||||
if ((err = init_get_bits(&gb, buf, buf_size * 8)) < 0)
|
||||
return err;
|
||||
|
||||
switch (ac->oc[1].m4ac.object_type) {
|
||||
|
@@ -165,7 +165,7 @@ static void put_audio_specific_config(AVCodecContext *avctx)
|
||||
PutBitContext pb;
|
||||
AACEncContext *s = avctx->priv_data;
|
||||
|
||||
init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
|
||||
init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8);
|
||||
put_bits(&pb, 5, 2); //object type - AAC-LC
|
||||
put_bits(&pb, 4, s->samplerate_index); //sample rate index
|
||||
put_bits(&pb, 4, s->channels);
|
||||
@@ -705,8 +705,8 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
|
||||
static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s)
|
||||
{
|
||||
int ch;
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->buffer.samples, s->channels, 3 * 1024 * sizeof(s->buffer.samples[0]), alloc_fail);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->cpe, s->chan_map[0], sizeof(ChannelElement), alloc_fail);
|
||||
FF_ALLOCZ_OR_GOTO(avctx, s->buffer.samples, 3 * 1024 * s->channels * sizeof(s->buffer.samples[0]), alloc_fail);
|
||||
FF_ALLOCZ_OR_GOTO(avctx, s->cpe, sizeof(ChannelElement) * s->chan_map[0], alloc_fail);
|
||||
FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 + FF_INPUT_BUFFER_PADDING_SIZE, alloc_fail);
|
||||
|
||||
for(ch = 0; ch < s->channels; ch++)
|
||||
@@ -746,10 +746,10 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
|
||||
s->chan_map = aac_chan_configs[s->channels-1];
|
||||
|
||||
if ((ret = dsp_init(avctx, s)) < 0)
|
||||
if (ret = dsp_init(avctx, s))
|
||||
goto fail;
|
||||
|
||||
if ((ret = alloc_buffers(avctx, s)) < 0)
|
||||
if (ret = alloc_buffers(avctx, s))
|
||||
goto fail;
|
||||
|
||||
avctx->extradata_size = 5;
|
||||
@@ -761,8 +761,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
lengths[1] = ff_aac_num_swb_128[i];
|
||||
for (i = 0; i < s->chan_map[0]; i++)
|
||||
grouping[i] = s->chan_map[i + 1] == TYPE_CPE;
|
||||
if ((ret = ff_psy_init(&s->psy, avctx, 2, sizes, lengths,
|
||||
s->chan_map[0], grouping)) < 0)
|
||||
if (ret = ff_psy_init(&s->psy, avctx, 2, sizes, lengths, s->chan_map[0], grouping))
|
||||
goto fail;
|
||||
s->psypp = ff_psy_preprocess_init(avctx);
|
||||
s->coder = &ff_aac_coders[s->options.aac_coder];
|
||||
|
@@ -82,7 +82,7 @@ int main(void)
|
||||
write_float_3d_array(f34_2_4, 4, 8, 2);
|
||||
printf("};\n");
|
||||
|
||||
printf("static const DECLARE_ALIGNED(16, float, Q_fract_allpass)[2][50][3][2] = {\n");
|
||||
printf("static TABLE_CONST DECLARE_ALIGNED(16, float, Q_fract_allpass)[2][50][3][2] = {\n");
|
||||
write_float_4d_array(Q_fract_allpass, 2, 50, 3, 2);
|
||||
printf("};\n");
|
||||
printf("static const DECLARE_ALIGNED(16, float, phi_fract)[2][50][2] = {\n");
|
||||
|
@@ -70,7 +70,7 @@ static const float g2_Q4[] = {
|
||||
0.16486303567403f, 0.23279856662996f, 0.25f
|
||||
};
|
||||
|
||||
static av_cold void make_filters_from_proto(float (*filter)[8][2], const float *proto, int bands)
|
||||
static void make_filters_from_proto(float (*filter)[8][2], const float *proto, int bands)
|
||||
{
|
||||
int q, n;
|
||||
for (q = 0; q < bands; q++) {
|
||||
@@ -82,7 +82,7 @@ static av_cold void make_filters_from_proto(float (*filter)[8][2], const float *
|
||||
}
|
||||
}
|
||||
|
||||
static av_cold void ps_tableinit(void)
|
||||
static void ps_tableinit(void)
|
||||
{
|
||||
static const float ipdopd_sin[] = { 0, M_SQRT1_2, 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2 };
|
||||
static const float ipdopd_cos[] = { 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2, 0, M_SQRT1_2 };
|
||||
|
@@ -313,7 +313,7 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
|
||||
ctx->bitres.size = 6144 - pctx->frame_bits;
|
||||
ctx->bitres.size -= ctx->bitres.size % 8;
|
||||
pctx->fill_level = ctx->bitres.size;
|
||||
minath = ath(3410 - 0.733 * ATH_ADD, ATH_ADD);
|
||||
minath = ath(3410, ATH_ADD);
|
||||
for (j = 0; j < 2; j++) {
|
||||
AacPsyCoeffs *coeffs = pctx->psy_coef[j];
|
||||
const uint8_t *band_sizes = ctx->bands[j];
|
||||
@@ -727,10 +727,7 @@ static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
|
||||
if (active_lines > 0.0f)
|
||||
band->thr = calc_reduced_thr_3gpp(band, coeffs[g].min_snr, reduction);
|
||||
pe += calc_pe_3gpp(band);
|
||||
if (band->thr > 0.0f)
|
||||
band->norm_fac = band->active_lines / band->thr;
|
||||
else
|
||||
band->norm_fac = 0.0f;
|
||||
band->norm_fac = band->active_lines / band->thr;
|
||||
norm_fac += band->norm_fac;
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,6 @@
|
||||
#include "sbr.h"
|
||||
#include "aacsbr.h"
|
||||
#include "aacsbrdata.h"
|
||||
#include "aacsbr_tablegen.h"
|
||||
#include "fft.h"
|
||||
#include "aacps.h"
|
||||
#include "sbrdsp.h"
|
||||
@@ -96,6 +95,7 @@ static void aacsbr_func_ptr_init(AACSBRContext *c);
|
||||
|
||||
av_cold void ff_aac_sbr_init(void)
|
||||
{
|
||||
int n;
|
||||
static const struct {
|
||||
const void *sbr_codes, *sbr_bits;
|
||||
const unsigned int table_size, elem_size;
|
||||
@@ -124,7 +124,13 @@ av_cold void ff_aac_sbr_init(void)
|
||||
SBR_INIT_VLC_STATIC(8, 592);
|
||||
SBR_INIT_VLC_STATIC(9, 512);
|
||||
|
||||
aacsbr_tableinit();
|
||||
for (n = 1; n < 320; n++)
|
||||
sbr_qmf_window_us[320 + n] = sbr_qmf_window_us[320 - n];
|
||||
sbr_qmf_window_us[384] = -sbr_qmf_window_us[384];
|
||||
sbr_qmf_window_us[512] = -sbr_qmf_window_us[512];
|
||||
|
||||
for (n = 0; n < 320; n++)
|
||||
sbr_qmf_window_ds[n] = sbr_qmf_window_us[2*n];
|
||||
|
||||
ff_ps_init();
|
||||
}
|
||||
@@ -514,7 +520,7 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
|
||||
/// High Frequency Generation - Patch Construction (14496-3 sp04 p216 fig. 4.46)
|
||||
static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
|
||||
{
|
||||
int i, k, last_k = -1, last_msb = -1, sb = 0;
|
||||
int i, k, sb = 0;
|
||||
int msb = sbr->k[0];
|
||||
int usb = sbr->kx[1];
|
||||
int goal_sb = ((1000 << 11) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
|
||||
@@ -528,12 +534,6 @@ static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
|
||||
|
||||
do {
|
||||
int odd = 0;
|
||||
if (k == last_k && msb == last_msb) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "patch construction failed\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
last_k = k;
|
||||
last_msb = msb;
|
||||
for (i = k; i == k || sb > (sbr->k[0] - 1 + msb - odd); i--) {
|
||||
sb = sbr->f_master[i];
|
||||
odd = (sb + sbr->k[0]) & 1;
|
||||
@@ -562,8 +562,7 @@ static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr)
|
||||
k = sbr->n_master;
|
||||
} while (sb != sbr->kx[1] + sbr->m[1]);
|
||||
|
||||
if (sbr->num_patches > 1 &&
|
||||
sbr->patch_num_subbands[sbr->num_patches - 1] < 3)
|
||||
if (sbr->num_patches > 1 && sbr->patch_num_subbands[sbr->num_patches-1] < 3)
|
||||
sbr->num_patches--;
|
||||
|
||||
return 0;
|
||||
@@ -1018,8 +1017,6 @@ static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,
|
||||
{
|
||||
unsigned int cnt = get_bits_count(gb);
|
||||
|
||||
sbr->id_aac = id_aac;
|
||||
|
||||
if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {
|
||||
if (read_sbr_single_channel_element(ac, sbr, gb)) {
|
||||
sbr_turnoff(sbr);
|
||||
@@ -1690,12 +1687,6 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
int nch = (id_aac == TYPE_CPE) ? 2 : 1;
|
||||
int err;
|
||||
|
||||
if (id_aac != sbr->id_aac) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"element type mismatch %d != %d\n", id_aac, sbr->id_aac);
|
||||
sbr_turnoff(sbr);
|
||||
}
|
||||
|
||||
if (!sbr->kx_and_m_pushed) {
|
||||
sbr->kx[0] = sbr->kx[1];
|
||||
sbr->m[0] = sbr->m[1];
|
||||
@@ -1719,7 +1710,6 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
sbr->c.sbr_hf_inverse_filter(&sbr->dsp, sbr->alpha0, sbr->alpha1,
|
||||
(const float (*)[40][2]) sbr->X_low, sbr->k[0]);
|
||||
sbr_chirp(sbr, &sbr->data[ch]);
|
||||
av_assert0(sbr->data[ch].bs_num_env > 0);
|
||||
sbr_hf_gen(ac, sbr, sbr->X_high,
|
||||
(const float (*)[40][2]) sbr->X_low,
|
||||
(const float (*)[2]) sbr->alpha0,
|
||||
|
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
* Header file for hardcoded AAC SBR windows
|
||||
*
|
||||
* Copyright (c) 2014 Reimar Döffinger <Reimar.Doeffinger@gmx.de>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg 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.
|
||||
*
|
||||
* FFmpeg 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 FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AACSBR_TABLEGEN_H
|
||||
#define AVCODEC_AACSBR_TABLEGEN_H
|
||||
|
||||
#if CONFIG_HARDCODED_TABLES
|
||||
#define aacsbr_tableinit()
|
||||
#include "libavcodec/aacsbr_tables.h"
|
||||
#else
|
||||
///< window coefficients for analysis/synthesis QMF banks
|
||||
static DECLARE_ALIGNED(32, float, sbr_qmf_window_ds)[320];
|
||||
static DECLARE_ALIGNED(32, float, sbr_qmf_window_us)[640] = {
|
||||
0.0000000000, -0.0005525286, -0.0005617692, -0.0004947518,
|
||||
-0.0004875227, -0.0004893791, -0.0005040714, -0.0005226564,
|
||||
-0.0005466565, -0.0005677802, -0.0005870930, -0.0006132747,
|
||||
-0.0006312493, -0.0006540333, -0.0006777690, -0.0006941614,
|
||||
-0.0007157736, -0.0007255043, -0.0007440941, -0.0007490598,
|
||||
-0.0007681371, -0.0007724848, -0.0007834332, -0.0007779869,
|
||||
-0.0007803664, -0.0007801449, -0.0007757977, -0.0007630793,
|
||||
-0.0007530001, -0.0007319357, -0.0007215391, -0.0006917937,
|
||||
-0.0006650415, -0.0006341594, -0.0005946118, -0.0005564576,
|
||||
-0.0005145572, -0.0004606325, -0.0004095121, -0.0003501175,
|
||||
-0.0002896981, -0.0002098337, -0.0001446380, -0.0000617334,
|
||||
0.0000134949, 0.0001094383, 0.0002043017, 0.0002949531,
|
||||
0.0004026540, 0.0005107388, 0.0006239376, 0.0007458025,
|
||||
0.0008608443, 0.0009885988, 0.0011250155, 0.0012577884,
|
||||
0.0013902494, 0.0015443219, 0.0016868083, 0.0018348265,
|
||||
0.0019841140, 0.0021461583, 0.0023017254, 0.0024625616,
|
||||
0.0026201758, 0.0027870464, 0.0029469447, 0.0031125420,
|
||||
0.0032739613, 0.0034418874, 0.0036008268, 0.0037603922,
|
||||
0.0039207432, 0.0040819753, 0.0042264269, 0.0043730719,
|
||||
0.0045209852, 0.0046606460, 0.0047932560, 0.0049137603,
|
||||
0.0050393022, 0.0051407353, 0.0052461166, 0.0053471681,
|
||||
0.0054196775, 0.0054876040, 0.0055475714, 0.0055938023,
|
||||
0.0056220643, 0.0056455196, 0.0056389199, 0.0056266114,
|
||||
0.0055917128, 0.0055404363, 0.0054753783, 0.0053838975,
|
||||
0.0052715758, 0.0051382275, 0.0049839687, 0.0048109469,
|
||||
0.0046039530, 0.0043801861, 0.0041251642, 0.0038456408,
|
||||
0.0035401246, 0.0032091885, 0.0028446757, 0.0024508540,
|
||||
0.0020274176, 0.0015784682, 0.0010902329, 0.0005832264,
|
||||
0.0000276045, -0.0005464280, -0.0011568135, -0.0018039472,
|
||||
-0.0024826723, -0.0031933778, -0.0039401124, -0.0047222596,
|
||||
-0.0055337211, -0.0063792293, -0.0072615816, -0.0081798233,
|
||||
-0.0091325329, -0.0101150215, -0.0111315548, -0.0121849995,
|
||||
0.0132718220, 0.0143904666, 0.0155405553, 0.0167324712,
|
||||
0.0179433381, 0.0191872431, 0.0204531793, 0.0217467550,
|
||||
0.0230680169, 0.0244160992, 0.0257875847, 0.0271859429,
|
||||
0.0286072173, 0.0300502657, 0.0315017608, 0.0329754081,
|
||||
0.0344620948, 0.0359697560, 0.0374812850, 0.0390053679,
|
||||
0.0405349170, 0.0420649094, 0.0436097542, 0.0451488405,
|
||||
0.0466843027, 0.0482165720, 0.0497385755, 0.0512556155,
|
||||
0.0527630746, 0.0542452768, 0.0557173648, 0.0571616450,
|
||||
0.0585915683, 0.0599837480, 0.0613455171, 0.0626857808,
|
||||
0.0639715898, 0.0652247106, 0.0664367512, 0.0676075985,
|
||||
0.0687043828, 0.0697630244, 0.0707628710, 0.0717002673,
|
||||
0.0725682583, 0.0733620255, 0.0741003642, 0.0747452558,
|
||||
0.0753137336, 0.0758008358, 0.0761992479, 0.0764992170,
|
||||
0.0767093490, 0.0768173975, 0.0768230011, 0.0767204924,
|
||||
0.0765050718, 0.0761748321, 0.0757305756, 0.0751576255,
|
||||
0.0744664394, 0.0736406005, 0.0726774642, 0.0715826364,
|
||||
0.0703533073, 0.0689664013, 0.0674525021, 0.0657690668,
|
||||
0.0639444805, 0.0619602779, 0.0598166570, 0.0575152691,
|
||||
0.0550460034, 0.0524093821, 0.0495978676, 0.0466303305,
|
||||
0.0434768782, 0.0401458278, 0.0366418116, 0.0329583930,
|
||||
0.0290824006, 0.0250307561, 0.0207997072, 0.0163701258,
|
||||
0.0117623832, 0.0069636862, 0.0019765601, -0.0032086896,
|
||||
-0.0085711749, -0.0141288827, -0.0198834129, -0.0258227288,
|
||||
-0.0319531274, -0.0382776572, -0.0447806821, -0.0514804176,
|
||||
-0.0583705326, -0.0654409853, -0.0726943300, -0.0801372934,
|
||||
-0.0877547536, -0.0955533352, -0.1035329531, -0.1116826931,
|
||||
-0.1200077984, -0.1285002850, -0.1371551761, -0.1459766491,
|
||||
-0.1549607071, -0.1640958855, -0.1733808172, -0.1828172548,
|
||||
-0.1923966745, -0.2021250176, -0.2119735853, -0.2219652696,
|
||||
-0.2320690870, -0.2423016884, -0.2526480309, -0.2631053299,
|
||||
-0.2736634040, -0.2843214189, -0.2950716717, -0.3059098575,
|
||||
-0.3168278913, -0.3278113727, -0.3388722693, -0.3499914122,
|
||||
0.3611589903, 0.3723795546, 0.3836350013, 0.3949211761,
|
||||
0.4062317676, 0.4175696896, 0.4289119920, 0.4402553754,
|
||||
0.4515996535, 0.4629308085, 0.4742453214, 0.4855253091,
|
||||
0.4967708254, 0.5079817500, 0.5191234970, 0.5302240895,
|
||||
0.5412553448, 0.5522051258, 0.5630789140, 0.5738524131,
|
||||
0.5845403235, 0.5951123086, 0.6055783538, 0.6159109932,
|
||||
0.6261242695, 0.6361980107, 0.6461269695, 0.6559016302,
|
||||
0.6655139880, 0.6749663190, 0.6842353293, 0.6933282376,
|
||||
0.7022388719, 0.7109410426, 0.7194462634, 0.7277448900,
|
||||
0.7358211758, 0.7436827863, 0.7513137456, 0.7587080760,
|
||||
0.7658674865, 0.7727780881, 0.7794287519, 0.7858353120,
|
||||
0.7919735841, 0.7978466413, 0.8034485751, 0.8087695004,
|
||||
0.8138191270, 0.8185776004, 0.8230419890, 0.8272275347,
|
||||
0.8311038457, 0.8346937361, 0.8379717337, 0.8409541392,
|
||||
0.8436238281, 0.8459818469, 0.8480315777, 0.8497805198,
|
||||
0.8511971524, 0.8523047035, 0.8531020949, 0.8535720573,
|
||||
0.8537385600,
|
||||
};
|
||||
|
||||
static av_cold void aacsbr_tableinit(void)
|
||||
{
|
||||
int n;
|
||||
for (n = 1; n < 320; n++)
|
||||
sbr_qmf_window_us[320 + n] = sbr_qmf_window_us[320 - n];
|
||||
sbr_qmf_window_us[384] = -sbr_qmf_window_us[384];
|
||||
sbr_qmf_window_us[512] = -sbr_qmf_window_us[512];
|
||||
|
||||
for (n = 0; n < 320; n++)
|
||||
sbr_qmf_window_ds[n] = sbr_qmf_window_us[2*n];
|
||||
}
|
||||
#endif /* CONFIG_HARDCODED_TABLES */
|
||||
|
||||
#endif /* AVCODEC_AACSBR_TABLEGEN_H */
|
@@ -266,6 +266,92 @@ static const int8_t sbr_offset[6][16] = {
|
||||
{-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24}, // 64000 Hz < fs_sbr
|
||||
};
|
||||
|
||||
///< window coefficients for analysis/synthesis QMF banks
|
||||
static DECLARE_ALIGNED(32, float, sbr_qmf_window_ds)[320];
|
||||
static DECLARE_ALIGNED(32, float, sbr_qmf_window_us)[640] = {
|
||||
0.0000000000, -0.0005525286, -0.0005617692, -0.0004947518,
|
||||
-0.0004875227, -0.0004893791, -0.0005040714, -0.0005226564,
|
||||
-0.0005466565, -0.0005677802, -0.0005870930, -0.0006132747,
|
||||
-0.0006312493, -0.0006540333, -0.0006777690, -0.0006941614,
|
||||
-0.0007157736, -0.0007255043, -0.0007440941, -0.0007490598,
|
||||
-0.0007681371, -0.0007724848, -0.0007834332, -0.0007779869,
|
||||
-0.0007803664, -0.0007801449, -0.0007757977, -0.0007630793,
|
||||
-0.0007530001, -0.0007319357, -0.0007215391, -0.0006917937,
|
||||
-0.0006650415, -0.0006341594, -0.0005946118, -0.0005564576,
|
||||
-0.0005145572, -0.0004606325, -0.0004095121, -0.0003501175,
|
||||
-0.0002896981, -0.0002098337, -0.0001446380, -0.0000617334,
|
||||
0.0000134949, 0.0001094383, 0.0002043017, 0.0002949531,
|
||||
0.0004026540, 0.0005107388, 0.0006239376, 0.0007458025,
|
||||
0.0008608443, 0.0009885988, 0.0011250155, 0.0012577884,
|
||||
0.0013902494, 0.0015443219, 0.0016868083, 0.0018348265,
|
||||
0.0019841140, 0.0021461583, 0.0023017254, 0.0024625616,
|
||||
0.0026201758, 0.0027870464, 0.0029469447, 0.0031125420,
|
||||
0.0032739613, 0.0034418874, 0.0036008268, 0.0037603922,
|
||||
0.0039207432, 0.0040819753, 0.0042264269, 0.0043730719,
|
||||
0.0045209852, 0.0046606460, 0.0047932560, 0.0049137603,
|
||||
0.0050393022, 0.0051407353, 0.0052461166, 0.0053471681,
|
||||
0.0054196775, 0.0054876040, 0.0055475714, 0.0055938023,
|
||||
0.0056220643, 0.0056455196, 0.0056389199, 0.0056266114,
|
||||
0.0055917128, 0.0055404363, 0.0054753783, 0.0053838975,
|
||||
0.0052715758, 0.0051382275, 0.0049839687, 0.0048109469,
|
||||
0.0046039530, 0.0043801861, 0.0041251642, 0.0038456408,
|
||||
0.0035401246, 0.0032091885, 0.0028446757, 0.0024508540,
|
||||
0.0020274176, 0.0015784682, 0.0010902329, 0.0005832264,
|
||||
0.0000276045, -0.0005464280, -0.0011568135, -0.0018039472,
|
||||
-0.0024826723, -0.0031933778, -0.0039401124, -0.0047222596,
|
||||
-0.0055337211, -0.0063792293, -0.0072615816, -0.0081798233,
|
||||
-0.0091325329, -0.0101150215, -0.0111315548, -0.0121849995,
|
||||
0.0132718220, 0.0143904666, 0.0155405553, 0.0167324712,
|
||||
0.0179433381, 0.0191872431, 0.0204531793, 0.0217467550,
|
||||
0.0230680169, 0.0244160992, 0.0257875847, 0.0271859429,
|
||||
0.0286072173, 0.0300502657, 0.0315017608, 0.0329754081,
|
||||
0.0344620948, 0.0359697560, 0.0374812850, 0.0390053679,
|
||||
0.0405349170, 0.0420649094, 0.0436097542, 0.0451488405,
|
||||
0.0466843027, 0.0482165720, 0.0497385755, 0.0512556155,
|
||||
0.0527630746, 0.0542452768, 0.0557173648, 0.0571616450,
|
||||
0.0585915683, 0.0599837480, 0.0613455171, 0.0626857808,
|
||||
0.0639715898, 0.0652247106, 0.0664367512, 0.0676075985,
|
||||
0.0687043828, 0.0697630244, 0.0707628710, 0.0717002673,
|
||||
0.0725682583, 0.0733620255, 0.0741003642, 0.0747452558,
|
||||
0.0753137336, 0.0758008358, 0.0761992479, 0.0764992170,
|
||||
0.0767093490, 0.0768173975, 0.0768230011, 0.0767204924,
|
||||
0.0765050718, 0.0761748321, 0.0757305756, 0.0751576255,
|
||||
0.0744664394, 0.0736406005, 0.0726774642, 0.0715826364,
|
||||
0.0703533073, 0.0689664013, 0.0674525021, 0.0657690668,
|
||||
0.0639444805, 0.0619602779, 0.0598166570, 0.0575152691,
|
||||
0.0550460034, 0.0524093821, 0.0495978676, 0.0466303305,
|
||||
0.0434768782, 0.0401458278, 0.0366418116, 0.0329583930,
|
||||
0.0290824006, 0.0250307561, 0.0207997072, 0.0163701258,
|
||||
0.0117623832, 0.0069636862, 0.0019765601, -0.0032086896,
|
||||
-0.0085711749, -0.0141288827, -0.0198834129, -0.0258227288,
|
||||
-0.0319531274, -0.0382776572, -0.0447806821, -0.0514804176,
|
||||
-0.0583705326, -0.0654409853, -0.0726943300, -0.0801372934,
|
||||
-0.0877547536, -0.0955533352, -0.1035329531, -0.1116826931,
|
||||
-0.1200077984, -0.1285002850, -0.1371551761, -0.1459766491,
|
||||
-0.1549607071, -0.1640958855, -0.1733808172, -0.1828172548,
|
||||
-0.1923966745, -0.2021250176, -0.2119735853, -0.2219652696,
|
||||
-0.2320690870, -0.2423016884, -0.2526480309, -0.2631053299,
|
||||
-0.2736634040, -0.2843214189, -0.2950716717, -0.3059098575,
|
||||
-0.3168278913, -0.3278113727, -0.3388722693, -0.3499914122,
|
||||
0.3611589903, 0.3723795546, 0.3836350013, 0.3949211761,
|
||||
0.4062317676, 0.4175696896, 0.4289119920, 0.4402553754,
|
||||
0.4515996535, 0.4629308085, 0.4742453214, 0.4855253091,
|
||||
0.4967708254, 0.5079817500, 0.5191234970, 0.5302240895,
|
||||
0.5412553448, 0.5522051258, 0.5630789140, 0.5738524131,
|
||||
0.5845403235, 0.5951123086, 0.6055783538, 0.6159109932,
|
||||
0.6261242695, 0.6361980107, 0.6461269695, 0.6559016302,
|
||||
0.6655139880, 0.6749663190, 0.6842353293, 0.6933282376,
|
||||
0.7022388719, 0.7109410426, 0.7194462634, 0.7277448900,
|
||||
0.7358211758, 0.7436827863, 0.7513137456, 0.7587080760,
|
||||
0.7658674865, 0.7727780881, 0.7794287519, 0.7858353120,
|
||||
0.7919735841, 0.7978466413, 0.8034485751, 0.8087695004,
|
||||
0.8138191270, 0.8185776004, 0.8230419890, 0.8272275347,
|
||||
0.8311038457, 0.8346937361, 0.8379717337, 0.8409541392,
|
||||
0.8436238281, 0.8459818469, 0.8480315777, 0.8497805198,
|
||||
0.8511971524, 0.8523047035, 0.8531020949, 0.8535720573,
|
||||
0.8537385600,
|
||||
};
|
||||
|
||||
/* First eight entries repeated at end to simplify SIMD implementations. */
|
||||
const DECLARE_ALIGNED(16, float, ff_sbr_noise_table)[][2] = {
|
||||
{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
|
||||
|
@@ -336,7 +336,7 @@ function fft_pass_neon
|
||||
endfunc
|
||||
|
||||
.macro def_fft n, n2, n4
|
||||
function fft\n\()_neon, align=6
|
||||
function fft\n\()_neon align=6
|
||||
sub sp, sp, #16
|
||||
stp x28, x30, [sp]
|
||||
add x28, x0, #\n4*2*8
|
||||
|
@@ -78,7 +78,6 @@ av_cold void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
|
||||
c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
|
||||
c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
|
||||
c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
|
||||
if (chroma_format_idc <= 1)
|
||||
c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
|
||||
|
||||
c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
|
||||
|
@@ -27,73 +27,73 @@
|
||||
#include "libavutil/aarch64/cpu.h"
|
||||
#include "libavcodec/h264qpel.h"
|
||||
|
||||
void ff_put_h264_qpel16_mc00_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc10_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc20_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc30_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc01_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc11_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc21_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc31_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc02_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc12_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc22_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc32_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc03_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc13_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc23_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc33_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
void ff_put_h264_qpel8_mc00_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc10_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc20_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc30_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc01_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc11_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc21_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc31_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc02_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc12_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc22_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc32_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc03_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc13_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc23_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc33_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
void ff_avg_h264_qpel16_mc00_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc10_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc20_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc30_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc01_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc11_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc21_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc31_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc02_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc12_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc22_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc32_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc03_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc13_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc23_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc33_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
void ff_avg_h264_qpel8_mc00_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc10_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc20_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc30_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc01_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc11_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc21_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc31_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc02_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc12_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc22_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc32_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc03_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc13_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc23_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc33_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc00_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc10_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc20_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc30_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc01_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc11_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc21_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc31_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc02_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc12_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc22_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc32_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc03_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc13_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc23_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc33_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
av_cold void ff_h264qpel_init_aarch64(H264QpelContext *c, int bit_depth)
|
||||
{
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#define WFRAC_BITS 16 // fractional bits for window
|
||||
#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15)
|
||||
|
||||
const tbl_rev128.s, align=4
|
||||
const tbl_rev128.s align=4
|
||||
.byte 12, 13, 14, 15
|
||||
.byte 8, 9, 10, 11
|
||||
.byte 4, 5, 6, 7
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include "asm-offsets.h"
|
||||
|
||||
.macro shuffle a, b, c, d
|
||||
const shuffle_\a\b\c\d, align=4
|
||||
const shuffle_\a\b\c\d align=4
|
||||
.byte (\a * 4), (\a * 4 + 1), (\a * 4 + 2), (\a * 4 + 3)
|
||||
.byte (\b * 4), (\b * 4 + 1), (\b * 4 + 2), (\b * 4 + 3)
|
||||
.byte (\c * 4), (\c * 4 + 1), (\c * 4 + 2), (\c * 4 + 3)
|
||||
@@ -344,7 +344,7 @@ function fft15_pass
|
||||
ret
|
||||
endfunc
|
||||
|
||||
function fft30_neon, align=6
|
||||
function fft30_neon align=6
|
||||
sub sp, sp, #0x20
|
||||
stp x20, x21, [sp]
|
||||
stp x22, x30, [sp, #0x10]
|
||||
@@ -372,7 +372,7 @@ function fft30_neon, align=6
|
||||
endfunc
|
||||
|
||||
.macro def_fft n, n2
|
||||
function fft\n\()_neon, align=6
|
||||
function fft\n\()_neon align=6
|
||||
sub sp, sp, #0x30
|
||||
stp x20, x21, [sp]
|
||||
stp x22, x30, [sp, #0x10]
|
||||
@@ -641,7 +641,7 @@ function ff_celt_imdct_half_neon, export=1
|
||||
endfunc
|
||||
|
||||
// [0] = exp(2 * i * pi / 5), [1] = exp(2 * i * pi * 2 / 5)
|
||||
const fact5, align=4
|
||||
const fact5 align=4
|
||||
.float 0.30901699437494745, 0.95105651629515353
|
||||
.float -0.80901699437494734, 0.58778525229247325
|
||||
endconst
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Autodesk RLE Decoder
|
||||
* Copyright (c) 2005 The FFmpeg Project
|
||||
* Copyright (C) 2005 the ffmpeg project
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
@@ -137,7 +137,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
||||
return ret;
|
||||
|
||||
/* report that the buffer was completely consumed */
|
||||
return avpkt->size;
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
static av_cold int aasc_decode_end(AVCodecContext *avctx)
|
||||
|
@@ -131,9 +131,6 @@ int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd,
|
||||
int band_start, band_end, begin, end1;
|
||||
int lowcomp, fastleak, slowleak;
|
||||
|
||||
if (end <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
/* excitation function */
|
||||
band_start = ff_ac3_bin_to_band_tab[start];
|
||||
band_end = ff_ac3_bin_to_band_tab[end-1] + 1;
|
||||
|
@@ -67,8 +67,7 @@
|
||||
#define AC3_RENAME(x) x ## _fixed
|
||||
#define AC3_NORM(norm) (1<<24)/(norm)
|
||||
#define AC3_MUL(a,b) ((((int64_t) (a)) * (b))>>12)
|
||||
#define AC3_RANGE(x) (x|((x&128)<<1))
|
||||
#define AC3_HEAVY_RANGE(x) (x<<1)
|
||||
#define AC3_RANGE(x) (x)
|
||||
#define AC3_DYNAMIC_RANGE(x) (x)
|
||||
#define AC3_SPX_BLEND(x) (x)
|
||||
#define AC3_DYNAMIC_RANGE1 0
|
||||
@@ -87,7 +86,6 @@
|
||||
#define AC3_NORM(norm) (1.0f/(norm))
|
||||
#define AC3_MUL(a,b) ((a) * (b))
|
||||
#define AC3_RANGE(x) (dynamic_range_tab[(x)])
|
||||
#define AC3_HEAVY_RANGE(x) (heavy_dynamic_range_tab[(x)])
|
||||
#define AC3_DYNAMIC_RANGE(x) (powf(x, s->drc_scale))
|
||||
#define AC3_SPX_BLEND(x) (x)* (1.0f/32)
|
||||
#define AC3_DYNAMIC_RANGE1 1.0f
|
||||
|
@@ -166,7 +166,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
||||
int err;
|
||||
union {
|
||||
uint64_t u64;
|
||||
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
|
||||
uint8_t u8[8];
|
||||
} tmp = { av_be2ne64(state) };
|
||||
AC3HeaderInfo hdr, *phdr = &hdr;
|
||||
GetBitContext gbc;
|
||||
|
@@ -65,7 +65,6 @@ static const uint8_t quantization_tab[16] = {
|
||||
|
||||
/** dynamic range table. converts codes to scale factors. */
|
||||
static float dynamic_range_tab[256];
|
||||
static float heavy_dynamic_range_tab[256];
|
||||
|
||||
/** Adjustments in dB gain */
|
||||
static const float gain_levels[9] = {
|
||||
@@ -165,14 +164,6 @@ static av_cold void ac3_tables_init(void)
|
||||
int v = (i >> 5) - ((i >> 7) << 3) - 5;
|
||||
dynamic_range_tab[i] = powf(2.0f, v) * ((i & 0x1F) | 0x20);
|
||||
}
|
||||
|
||||
/* generate compr dynamic range table
|
||||
reference: Section 7.7.2 Heavy Compression */
|
||||
for (i = 0; i < 256; i++) {
|
||||
int v = (i >> 4) - ((i >> 7) << 4) - 4;
|
||||
heavy_dynamic_range_tab[i] = powf(2.0f, v) * ((i & 0xF) | 0x10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -245,19 +236,9 @@ static int ac3_parse_header(AC3DecodeContext *s)
|
||||
/* read the rest of the bsi. read twice for dual mono mode. */
|
||||
i = !s->channel_mode;
|
||||
do {
|
||||
s->dialog_normalization[(!s->channel_mode)-i] = -get_bits(gbc, 5);
|
||||
if (s->dialog_normalization[(!s->channel_mode)-i] == 0) {
|
||||
s->dialog_normalization[(!s->channel_mode)-i] = -31;
|
||||
}
|
||||
if (s->target_level != 0) {
|
||||
s->level_gain[(!s->channel_mode)-i] = powf(2.0f,
|
||||
(float)(s->target_level -
|
||||
s->dialog_normalization[(!s->channel_mode)-i])/6.0f);
|
||||
}
|
||||
if (s->compression_exists[(!s->channel_mode)-i] = get_bits1(gbc)) {
|
||||
s->heavy_dynamic_range[(!s->channel_mode)-i] =
|
||||
AC3_HEAVY_RANGE(get_bits(gbc, 8));
|
||||
}
|
||||
skip_bits(gbc, 5); // skip dialog normalization
|
||||
if (get_bits1(gbc))
|
||||
skip_bits(gbc, 8); //skip compression
|
||||
if (get_bits1(gbc))
|
||||
skip_bits(gbc, 8); //skip language code
|
||||
if (get_bits1(gbc))
|
||||
@@ -838,9 +819,8 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
if (get_bits1(gbc)) {
|
||||
/* Allow asymmetric application of DRC when drc_scale > 1.
|
||||
Amplification of quiet sounds is enhanced */
|
||||
int range_bits = get_bits(gbc, 8);
|
||||
INTFLOAT range = AC3_RANGE(range_bits);
|
||||
if (range_bits <= 127 || s->drc_scale <= 1.0)
|
||||
INTFLOAT range = AC3_RANGE(get_bits(gbc, 8));
|
||||
if (range > 1.0 || s->drc_scale <= 1.0)
|
||||
s->dynamic_range[i] = AC3_DYNAMIC_RANGE(range);
|
||||
else
|
||||
s->dynamic_range[i] = range;
|
||||
@@ -872,7 +852,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
start_subband += start_subband - 7;
|
||||
end_subband = get_bits(gbc, 3) + 5;
|
||||
#if USE_FIXED
|
||||
s->spx_dst_end_freq = end_freq_inv_tab[end_subband-5];
|
||||
s->spx_dst_end_freq = end_freq_inv_tab[end_subband];
|
||||
#endif
|
||||
if (end_subband > 7)
|
||||
end_subband += end_subband - 7;
|
||||
@@ -939,7 +919,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
nblend = 0;
|
||||
sblend = 0x800000;
|
||||
} else if (nratio > 0x7fffff) {
|
||||
nblend = 14529495; // sqrt(3) in FP.23
|
||||
nblend = 0x800000;
|
||||
sblend = 0;
|
||||
} else {
|
||||
nblend = fixed_sqrt(nratio, 23);
|
||||
@@ -1334,20 +1314,15 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
|
||||
/* apply scaling to coefficients (headroom, dynrng) */
|
||||
for (ch = 1; ch <= s->channels; ch++) {
|
||||
int audio_channel = 0;
|
||||
INTFLOAT gain;
|
||||
if (s->channel_mode == AC3_CHMODE_DUALMONO)
|
||||
audio_channel = 2-ch;
|
||||
if (s->heavy_compression && s->compression_exists[audio_channel])
|
||||
gain = s->heavy_dynamic_range[audio_channel];
|
||||
else
|
||||
gain = s->dynamic_range[audio_channel];
|
||||
|
||||
if(s->channel_mode == AC3_CHMODE_DUALMONO) {
|
||||
gain = s->dynamic_range[2-ch];
|
||||
} else {
|
||||
gain = s->dynamic_range[0];
|
||||
}
|
||||
#if USE_FIXED
|
||||
scale_coefs(s->transform_coeffs[ch], s->fixed_coeffs[ch], gain, 256);
|
||||
#else
|
||||
if (s->target_level != 0)
|
||||
gain = gain * s->level_gain[audio_channel];
|
||||
gain *= 1.0 / 4194304.0f;
|
||||
s->fmt_conv.int32_to_float_fmul_scalar(s->transform_coeffs[ch],
|
||||
s->fixed_coeffs[ch], gain, 256);
|
||||
|
@@ -84,9 +84,6 @@ typedef struct AC3DecodeContext {
|
||||
int bitstream_mode; ///< bitstream mode (bsmod)
|
||||
int channel_mode; ///< channel mode (acmod)
|
||||
int lfe_on; ///< lfe channel in use
|
||||
int dialog_normalization[2]; ///< dialog level in dBFS (dialnorm)
|
||||
int compression_exists[2]; ///< compression field is valid for frame (compre)
|
||||
int compression_gain[2]; ///< gain to apply for heavy compression (compr)
|
||||
int channel_map; ///< custom channel map
|
||||
int preferred_downmix; ///< Preferred 2-channel downmix mode (dmixmod)
|
||||
int center_mix_level; ///< Center mix level index
|
||||
@@ -106,8 +103,6 @@ typedef struct AC3DecodeContext {
|
||||
float ltrt_surround_mix_level;
|
||||
float loro_center_mix_level;
|
||||
float loro_surround_mix_level;
|
||||
int target_level; ///< target level in dBFS
|
||||
float level_gain[2];
|
||||
|
||||
///@name Frame syntax parameters
|
||||
int snr_offset_strategy; ///< SNR offset strategy (snroffststr)
|
||||
@@ -166,8 +161,6 @@ typedef struct AC3DecodeContext {
|
||||
///@name Dynamic range
|
||||
INTFLOAT dynamic_range[2]; ///< dynamic range
|
||||
INTFLOAT drc_scale; ///< percentage of dynamic range compression to be applied
|
||||
int heavy_compression; ///< apply heavy compression
|
||||
INTFLOAT heavy_dynamic_range[2]; ///< heavy dynamic range compression
|
||||
///@}
|
||||
|
||||
///@name Bandwidth
|
||||
@@ -243,19 +236,19 @@ typedef struct AC3DecodeContext {
|
||||
* Parse the E-AC-3 frame header.
|
||||
* This parses both the bit stream info and audio frame header.
|
||||
*/
|
||||
static int ff_eac3_parse_header(AC3DecodeContext *s);
|
||||
int ff_eac3_parse_header(AC3DecodeContext *s);
|
||||
|
||||
/**
|
||||
* Decode mantissas in a single channel for the entire frame.
|
||||
* This is used when AHT mode is enabled.
|
||||
*/
|
||||
static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
|
||||
void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch);
|
||||
|
||||
/**
|
||||
* Apply spectral extension to each channel by copying lower frequency
|
||||
* coefficients to higher frequency bins and applying side information to
|
||||
* approximate the original high frequency signal.
|
||||
*/
|
||||
static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
|
||||
void ff_eac3_apply_spectral_extension(AC3DecodeContext *s);
|
||||
|
||||
#endif /* AVCODEC_AC3DEC_H */
|
||||
|
@@ -53,7 +53,19 @@
|
||||
#include "ac3dec.h"
|
||||
|
||||
|
||||
static const int end_freq_inv_tab[8] =
|
||||
/**
|
||||
* Table for center mix levels
|
||||
* reference: Section 5.4.2.4 cmixlev
|
||||
*/
|
||||
static const uint8_t center_levels[4] = { 4, 5, 6, 5 };
|
||||
|
||||
/**
|
||||
* Table for surround mix levels
|
||||
* reference: Section 5.4.2.5 surmixlev
|
||||
*/
|
||||
static const uint8_t surround_levels[4] = { 4, 6, 7, 6 };
|
||||
|
||||
int end_freq_inv_tab[8] =
|
||||
{
|
||||
50529027, 44278013, 39403370, 32292987, 27356480, 23729101, 20951060, 18755316
|
||||
};
|
||||
@@ -69,69 +81,40 @@ static void scale_coefs (
|
||||
int temp, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
|
||||
|
||||
mul = (dynrng & 0x1f) + 0x20;
|
||||
shift = 4 - ((dynrng << 23) >> 28);
|
||||
if (shift > 0 ) {
|
||||
round = 1 << (shift-1);
|
||||
for (i=0; i<len; i+=8) {
|
||||
shift = 4 - ((dynrng << 24) >> 29);
|
||||
round = 1 << (shift-1);
|
||||
for (i=0; i<len; i+=8) {
|
||||
|
||||
temp = src[i] * mul;
|
||||
temp1 = src[i+1] * mul;
|
||||
temp = temp + round;
|
||||
temp2 = src[i+2] * mul;
|
||||
temp = src[i] * mul;
|
||||
temp1 = src[i+1] * mul;
|
||||
temp = temp + round;
|
||||
temp2 = src[i+2] * mul;
|
||||
|
||||
temp1 = temp1 + round;
|
||||
dst[i] = temp >> shift;
|
||||
temp3 = src[i+3] * mul;
|
||||
temp2 = temp2 + round;
|
||||
temp1 = temp1 + round;
|
||||
dst[i] = temp >> shift;
|
||||
temp3 = src[i+3] * mul;
|
||||
temp2 = temp2 + round;
|
||||
|
||||
dst[i+1] = temp1 >> shift;
|
||||
temp4 = src[i + 4] * mul;
|
||||
temp3 = temp3 + round;
|
||||
dst[i+2] = temp2 >> shift;
|
||||
dst[i+1] = temp1 >> shift;
|
||||
temp4 = src[i + 4] * mul;
|
||||
temp3 = temp3 + round;
|
||||
dst[i+2] = temp2 >> shift;
|
||||
|
||||
temp5 = src[i+5] * mul;
|
||||
temp4 = temp4 + round;
|
||||
dst[i+3] = temp3 >> shift;
|
||||
temp6 = src[i+6] * mul;
|
||||
temp5 = src[i+5] * mul;
|
||||
temp4 = temp4 + round;
|
||||
dst[i+3] = temp3 >> shift;
|
||||
temp6 = src[i+6] * mul;
|
||||
|
||||
dst[i+4] = temp4 >> shift;
|
||||
temp5 = temp5 + round;
|
||||
temp7 = src[i+7] * mul;
|
||||
temp6 = temp6 + round;
|
||||
dst[i+4] = temp4 >> shift;
|
||||
temp5 = temp5 + round;
|
||||
temp7 = src[i+7] * mul;
|
||||
temp6 = temp6 + round;
|
||||
|
||||
dst[i+5] = temp5 >> shift;
|
||||
temp7 = temp7 + round;
|
||||
dst[i+6] = temp6 >> shift;
|
||||
dst[i+7] = temp7 >> shift;
|
||||
dst[i+5] = temp5 >> shift;
|
||||
temp7 = temp7 + round;
|
||||
dst[i+6] = temp6 >> shift;
|
||||
dst[i+7] = temp7 >> shift;
|
||||
|
||||
}
|
||||
} else {
|
||||
shift = -shift;
|
||||
for (i=0; i<len; i+=8) {
|
||||
|
||||
temp = src[i] * mul;
|
||||
temp1 = src[i+1] * mul;
|
||||
temp2 = src[i+2] * mul;
|
||||
|
||||
dst[i] = temp << shift;
|
||||
temp3 = src[i+3] * mul;
|
||||
|
||||
dst[i+1] = temp1 << shift;
|
||||
temp4 = src[i + 4] * mul;
|
||||
dst[i+2] = temp2 << shift;
|
||||
|
||||
temp5 = src[i+5] * mul;
|
||||
dst[i+3] = temp3 << shift;
|
||||
temp6 = src[i+6] * mul;
|
||||
|
||||
dst[i+4] = temp4 << shift;
|
||||
temp7 = src[i+7] * mul;
|
||||
|
||||
dst[i+5] = temp5 << shift;
|
||||
dst[i+6] = temp6 << shift;
|
||||
dst[i+7] = temp7 << shift;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,12 +147,9 @@ static void ac3_downmix_c_fixed16(int16_t **samples, int16_t (*matrix)[2],
|
||||
}
|
||||
}
|
||||
|
||||
#include "eac3dec.c"
|
||||
#include "ac3dec.c"
|
||||
|
||||
static const AVOption options[] = {
|
||||
{ "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 1.0}, 0.0, 6.0, PAR },
|
||||
{ "heavy_compr", "heavy dynamic range compression enabled", OFFSET(heavy_compression), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, PAR },
|
||||
{ NULL},
|
||||
};
|
||||
|
||||
|
@@ -28,13 +28,10 @@
|
||||
* Upmix delay samples from stereo to original channel layout.
|
||||
*/
|
||||
#include "ac3dec.h"
|
||||
#include "eac3dec.c"
|
||||
#include "ac3dec.c"
|
||||
|
||||
static const AVOption options[] = {
|
||||
{ "drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 1.0}, 0.0, 6.0, PAR },
|
||||
{ "heavy_compr", "heavy dynamic range compression enabled", OFFSET(heavy_compression), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, PAR },
|
||||
{ "target_level", "target level in -dBFS (0 not applied)", OFFSET(target_level), AV_OPT_TYPE_INT, {.i64 = 0 }, -31, 0, PAR },
|
||||
|
||||
{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 2, 0, "dmix_mode"},
|
||||
{"ltrt_cmixlev", "Lt/Rt Center Mix Level", OFFSET(ltrt_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, 0},
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "avcodec.h"
|
||||
#include "me_cmp.h"
|
||||
#include "put_bits.h"
|
||||
#include "audiodsp.h"
|
||||
#include "ac3dsp.h"
|
||||
@@ -380,7 +379,7 @@ static void compute_exp_strategy(AC3EncodeContext *s)
|
||||
exp_strategy[blk] = EXP_NEW;
|
||||
continue;
|
||||
}
|
||||
exp_diff = s->mecc.sad[0](NULL, exp, exp - AC3_MAX_COEFS, 16, 16);
|
||||
exp_diff = s->dsp.sad[0](NULL, exp, exp - AC3_MAX_COEFS, 16, 16);
|
||||
exp_strategy[blk] = EXP_REUSE;
|
||||
if (ch == CPL_CH && exp_diff > (EXP_DIFF_THRESHOLD * (s->blocks[blk].end_freq[ch] - s->start_freq[ch]) / AC3_MAX_COEFS))
|
||||
exp_strategy[blk] = EXP_NEW;
|
||||
@@ -2327,50 +2326,50 @@ static av_cold int allocate_buffers(AC3EncodeContext *s)
|
||||
if (s->allocate_sample_buffers(s))
|
||||
goto alloc_fail;
|
||||
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, s->bap_buffer, total_coefs,
|
||||
FF_ALLOC_OR_GOTO(avctx, s->bap_buffer, total_coefs *
|
||||
sizeof(*s->bap_buffer), alloc_fail);
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, s->bap1_buffer, total_coefs,
|
||||
FF_ALLOC_OR_GOTO(avctx, s->bap1_buffer, total_coefs *
|
||||
sizeof(*s->bap1_buffer), alloc_fail);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->mdct_coef_buffer, total_coefs,
|
||||
FF_ALLOCZ_OR_GOTO(avctx, s->mdct_coef_buffer, total_coefs *
|
||||
sizeof(*s->mdct_coef_buffer), alloc_fail);
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, s->exp_buffer, total_coefs,
|
||||
FF_ALLOC_OR_GOTO(avctx, s->exp_buffer, total_coefs *
|
||||
sizeof(*s->exp_buffer), alloc_fail);
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, s->grouped_exp_buffer, channel_blocks, 128 *
|
||||
FF_ALLOC_OR_GOTO(avctx, s->grouped_exp_buffer, channel_blocks * 128 *
|
||||
sizeof(*s->grouped_exp_buffer), alloc_fail);
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, s->psd_buffer, total_coefs,
|
||||
FF_ALLOC_OR_GOTO(avctx, s->psd_buffer, total_coefs *
|
||||
sizeof(*s->psd_buffer), alloc_fail);
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, s->band_psd_buffer, channel_blocks, 64 *
|
||||
FF_ALLOC_OR_GOTO(avctx, s->band_psd_buffer, channel_blocks * 64 *
|
||||
sizeof(*s->band_psd_buffer), alloc_fail);
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, s->mask_buffer, channel_blocks, 64 *
|
||||
FF_ALLOC_OR_GOTO(avctx, s->mask_buffer, channel_blocks * 64 *
|
||||
sizeof(*s->mask_buffer), alloc_fail);
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, s->qmant_buffer, total_coefs,
|
||||
FF_ALLOC_OR_GOTO(avctx, s->qmant_buffer, total_coefs *
|
||||
sizeof(*s->qmant_buffer), alloc_fail);
|
||||
if (s->cpl_enabled) {
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, s->cpl_coord_exp_buffer, channel_blocks, 16 *
|
||||
FF_ALLOC_OR_GOTO(avctx, s->cpl_coord_exp_buffer, channel_blocks * 16 *
|
||||
sizeof(*s->cpl_coord_exp_buffer), alloc_fail);
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, s->cpl_coord_mant_buffer, channel_blocks, 16 *
|
||||
FF_ALLOC_OR_GOTO(avctx, s->cpl_coord_mant_buffer, channel_blocks * 16 *
|
||||
sizeof(*s->cpl_coord_mant_buffer), alloc_fail);
|
||||
}
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->mdct_coef, channels, sizeof(*block->mdct_coef),
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->mdct_coef, channels * sizeof(*block->mdct_coef),
|
||||
alloc_fail);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->exp, channels, sizeof(*block->exp),
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->exp, channels * sizeof(*block->exp),
|
||||
alloc_fail);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->grouped_exp, channels, sizeof(*block->grouped_exp),
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->grouped_exp, channels * sizeof(*block->grouped_exp),
|
||||
alloc_fail);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->psd, channels, sizeof(*block->psd),
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->psd, channels * sizeof(*block->psd),
|
||||
alloc_fail);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->band_psd, channels, sizeof(*block->band_psd),
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->band_psd, channels * sizeof(*block->band_psd),
|
||||
alloc_fail);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->mask, channels, sizeof(*block->mask),
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->mask, channels * sizeof(*block->mask),
|
||||
alloc_fail);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->qmant, channels, sizeof(*block->qmant),
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->qmant, channels * sizeof(*block->qmant),
|
||||
alloc_fail);
|
||||
if (s->cpl_enabled) {
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->cpl_coord_exp, channels, sizeof(*block->cpl_coord_exp),
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->cpl_coord_exp, channels * sizeof(*block->cpl_coord_exp),
|
||||
alloc_fail);
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->cpl_coord_mant, channels, sizeof(*block->cpl_coord_mant),
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->cpl_coord_mant, channels * sizeof(*block->cpl_coord_mant),
|
||||
alloc_fail);
|
||||
}
|
||||
|
||||
@@ -2393,11 +2392,11 @@ static av_cold int allocate_buffers(AC3EncodeContext *s)
|
||||
}
|
||||
|
||||
if (!s->fixed_point) {
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, s->fixed_coef_buffer, total_coefs,
|
||||
FF_ALLOCZ_OR_GOTO(avctx, s->fixed_coef_buffer, total_coefs *
|
||||
sizeof(*s->fixed_coef_buffer), alloc_fail);
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->fixed_coef, channels,
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->fixed_coef, channels *
|
||||
sizeof(*block->fixed_coef), alloc_fail);
|
||||
for (ch = 0; ch < channels; ch++)
|
||||
block->fixed_coef[ch] = &s->fixed_coef_buffer[AC3_MAX_COEFS * (s->num_blocks * ch + blk)];
|
||||
@@ -2405,7 +2404,7 @@ static av_cold int allocate_buffers(AC3EncodeContext *s)
|
||||
} else {
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
FF_ALLOCZ_ARRAY_OR_GOTO(avctx, block->fixed_coef, channels,
|
||||
FF_ALLOCZ_OR_GOTO(avctx, block->fixed_coef, channels *
|
||||
sizeof(*block->fixed_coef), alloc_fail);
|
||||
for (ch = 0; ch < channels; ch++)
|
||||
block->fixed_coef[ch] = (int32_t *)block->mdct_coef[ch];
|
||||
@@ -2481,7 +2480,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
|
||||
goto init_fail;
|
||||
|
||||
ff_audiodsp_init(&s->adsp);
|
||||
ff_me_cmp_init(&s->mecc, avctx);
|
||||
ff_dsputil_init(&s->dsp, avctx);
|
||||
ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
|
||||
dprint_options(s);
|
||||
|
@@ -35,9 +35,9 @@
|
||||
#include "ac3.h"
|
||||
#include "ac3dsp.h"
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "fft.h"
|
||||
#include "mathops.h"
|
||||
#include "me_cmp.h"
|
||||
#include "put_bits.h"
|
||||
#include "audiodsp.h"
|
||||
|
||||
@@ -162,9 +162,9 @@ typedef struct AC3EncodeContext {
|
||||
AC3EncOptions options; ///< encoding options
|
||||
AVCodecContext *avctx; ///< parent AVCodecContext
|
||||
PutBitContext pb; ///< bitstream writer context
|
||||
DSPContext dsp;
|
||||
AudioDSPContext adsp;
|
||||
AVFloatDSPContext fdsp;
|
||||
MECmpContext mecc;
|
||||
AC3DSPContext ac3dsp; ///< AC-3 optimized functions
|
||||
FFTContext mdct; ///< FFT context for MDCT calculation
|
||||
const SampleType *mdct_window; ///< MDCT window function array
|
||||
|
@@ -57,7 +57,7 @@ int AC3_NAME(allocate_sample_buffers)(AC3EncodeContext *s)
|
||||
|
||||
FF_ALLOC_OR_GOTO(s->avctx, s->windowed_samples, AC3_WINDOW_SIZE *
|
||||
sizeof(*s->windowed_samples), alloc_fail);
|
||||
FF_ALLOC_ARRAY_OR_GOTO(s->avctx, s->planar_samples, s->channels, sizeof(*s->planar_samples),
|
||||
FF_ALLOC_OR_GOTO(s->avctx, s->planar_samples, s->channels * sizeof(*s->planar_samples),
|
||||
alloc_fail);
|
||||
for (ch = 0; ch < s->channels; ch++) {
|
||||
FF_ALLOCZ_OR_GOTO(s->avctx, s->planar_samples[ch],
|
||||
@@ -263,7 +263,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
|
||||
energy_cpl = energy[blk][CPL_CH][bnd];
|
||||
energy_ch = energy[blk][ch][bnd];
|
||||
blk1 = blk+1;
|
||||
while (blk1 < s->num_blocks && !s->blocks[blk1].new_cpl_coords[ch]) {
|
||||
while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
|
||||
if (s->blocks[blk1].cpl_in_use) {
|
||||
energy_cpl += energy[blk1][CPL_CH][bnd];
|
||||
energy_ch += energy[blk1][ch][bnd];
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2003 The FFmpeg Project
|
||||
* Copyright (c) 2001-2003 The ffmpeg Project
|
||||
*
|
||||
* first version by Francois Revol (revol@free.fr)
|
||||
* fringe ADPCM codecs (e.g., DK3, DK4, Westwood)
|
||||
@@ -574,8 +574,6 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
|
||||
case AV_CODEC_ID_ADPCM_IMA_DK4:
|
||||
if (avctx->block_align > 0)
|
||||
buf_size = FFMIN(buf_size, avctx->block_align);
|
||||
if (buf_size < 4 * ch)
|
||||
return AVERROR_INVALIDDATA;
|
||||
nb_samples = 1 + (buf_size - 4 * ch) * 2 / ch;
|
||||
break;
|
||||
case AV_CODEC_ID_ADPCM_IMA_RAD:
|
||||
@@ -589,15 +587,13 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
|
||||
int bsamples = ff_adpcm_ima_block_samples[avctx->bits_per_coded_sample - 2];
|
||||
if (avctx->block_align > 0)
|
||||
buf_size = FFMIN(buf_size, avctx->block_align);
|
||||
if (buf_size < 4 * ch)
|
||||
return AVERROR_INVALIDDATA;
|
||||
nb_samples = 1 + (buf_size - 4 * ch) / (bsize * ch) * bsamples;
|
||||
break;
|
||||
}
|
||||
case AV_CODEC_ID_ADPCM_MS:
|
||||
if (avctx->block_align > 0)
|
||||
buf_size = FFMIN(buf_size, avctx->block_align);
|
||||
nb_samples = (buf_size - 6 * ch) * 2 / ch;
|
||||
nb_samples = 2 + (buf_size - 7 * ch) * 2 / ch;
|
||||
break;
|
||||
case AV_CODEC_ID_ADPCM_SBPRO_2:
|
||||
case AV_CODEC_ID_ADPCM_SBPRO_3:
|
||||
@@ -610,8 +606,6 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
|
||||
case AV_CODEC_ID_ADPCM_SBPRO_4: samples_per_byte = 2; break;
|
||||
}
|
||||
if (!s->status[0].step_index) {
|
||||
if (buf_size < ch)
|
||||
return AVERROR_INVALIDDATA;
|
||||
nb_samples++;
|
||||
buf_size -= ch;
|
||||
}
|
||||
@@ -1530,18 +1524,13 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
|
||||
if (avpkt->size < bytestream2_tell(&gb)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Overread of %d < %d\n", avpkt->size, bytestream2_tell(&gb));
|
||||
return avpkt->size;
|
||||
}
|
||||
|
||||
return bytestream2_tell(&gb);
|
||||
}
|
||||
|
||||
|
||||
static const enum AVSampleFormat sample_fmts_s16[] = { AV_SAMPLE_FMT_S16,
|
||||
AV_SAMPLE_FMT_NONE };
|
||||
static const enum AVSampleFormat sample_fmts_s16p[] = { AV_SAMPLE_FMT_S16P,
|
||||
static const enum AVSampleFormat sample_fmts_s16p[] = { AV_SAMPLE_FMT_S16,
|
||||
AV_SAMPLE_FMT_NONE };
|
||||
static const enum AVSampleFormat sample_fmts_both[] = { AV_SAMPLE_FMT_S16,
|
||||
AV_SAMPLE_FMT_S16P,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2003 The FFmpeg Project
|
||||
* Copyright (c) 2001-2003 The ffmpeg Project
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2003 The FFmpeg Project
|
||||
* Copyright (c) 2001-2003 The ffmpeg Project
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2003 The FFmpeg Project
|
||||
* Copyright (c) 2001-2003 The ffmpeg Project
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2003 The FFmpeg Project
|
||||
* Copyright (c) 2001-2003 The ffmpeg Project
|
||||
*
|
||||
* first version by Francois Revol (revol@free.fr)
|
||||
* fringe ADPCM codecs (e.g., DK3, DK4, Westwood)
|
||||
@@ -509,7 +509,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
|
||||
/* stereo: 4 bytes (8 samples) for left, 4 bytes for right */
|
||||
if (avctx->trellis > 0) {
|
||||
FF_ALLOC_ARRAY_OR_GOTO(avctx, buf, avctx->channels, blocks * 8, error);
|
||||
FF_ALLOC_OR_GOTO(avctx, buf, avctx->channels * blocks * 8, error);
|
||||
for (ch = 0; ch < avctx->channels; ch++) {
|
||||
adpcm_compress_trellis(avctx, &samples_p[ch][1],
|
||||
buf + ch * blocks * 8, &c->status[ch],
|
||||
@@ -541,7 +541,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
case AV_CODEC_ID_ADPCM_IMA_QT:
|
||||
{
|
||||
PutBitContext pb;
|
||||
init_put_bits(&pb, dst, pkt_size);
|
||||
init_put_bits(&pb, dst, pkt_size * 8);
|
||||
|
||||
for (ch = 0; ch < avctx->channels; ch++) {
|
||||
ADPCMChannelStatus *status = &c->status[ch];
|
||||
@@ -571,7 +571,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
case AV_CODEC_ID_ADPCM_SWF:
|
||||
{
|
||||
PutBitContext pb;
|
||||
init_put_bits(&pb, dst, pkt_size);
|
||||
init_put_bits(&pb, dst, pkt_size * 8);
|
||||
|
||||
n = frame->nb_samples - 1;
|
||||
|
||||
|
@@ -80,3 +80,11 @@ int ff_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
|
||||
*header_size = offset;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 56
|
||||
int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
|
||||
int bufsize, int *header_size, int *coeff)
|
||||
{
|
||||
return ff_adx_decode_header(avctx, buf, bufsize, header_size, coeff);
|
||||
}
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user