Compare commits
43 Commits
release/2.
...
n2.4.1
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e1ce4f805f | ||
![]() |
bb5c0ac922 | ||
![]() |
d389438296 | ||
![]() |
3b57d7769a | ||
![]() |
b7f2719951 | ||
![]() |
dc4e34a2f0 | ||
![]() |
d694ab846c | ||
![]() |
ab02548c8a | ||
![]() |
b45ab61b24 | ||
![]() |
cc73b4f574 | ||
![]() |
8ac3b2cdb7 | ||
![]() |
ace90ee265 | ||
![]() |
703bd31647 | ||
![]() |
c16e80ee3d | ||
![]() |
66ac5b96e8 | ||
![]() |
547cad8c81 | ||
![]() |
55b1a1e9c1 | ||
![]() |
f851477889 | ||
![]() |
4f2d4b98fc | ||
![]() |
7d8ebb8774 | ||
![]() |
07b0ccf511 | ||
![]() |
9d3e69ae30 | ||
![]() |
480633c6c2 | ||
![]() |
b5d4f49e3c | ||
![]() |
4cde8bae49 | ||
![]() |
5b740d1eaa | ||
![]() |
152e09fde7 | ||
![]() |
110841c3ab | ||
![]() |
5694831e06 | ||
![]() |
1f52f82a55 | ||
![]() |
e62f08ca8d | ||
![]() |
ee099059e7 | ||
![]() |
e2a89f7f0f | ||
![]() |
7c46855074 | ||
![]() |
c2d6cc2971 | ||
![]() |
8c91414803 | ||
![]() |
0263750a0d | ||
![]() |
63795fe5b9 | ||
![]() |
d2bad216f7 | ||
![]() |
d04fb11868 | ||
![]() |
e8f2823f06 | ||
![]() |
7dfccac20c | ||
![]() |
04361427e6 |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1 +0,0 @@
|
||||
*.pnm -diff -text
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -64,7 +64,6 @@
|
||||
/tests/data/
|
||||
/tests/pixfmts.mak
|
||||
/tests/rotozoom
|
||||
/tests/test_copy.ffmeta
|
||||
/tests/tiny_psnr
|
||||
/tests/tiny_ssim
|
||||
/tests/videogen
|
||||
|
554
Changelog
554
Changelog
@@ -1,553 +1,15 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 2.5.11
|
||||
- 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/libquvi: Set default demuxer and protocol limitations
|
||||
- avformat/concat: Check protocol prefix
|
||||
- doc/demuxers: Document enable_drefs and use_absolute_path
|
||||
- avcodec/mjpegdec: Check for end for both bytes in unescaping
|
||||
- avcodec/mpegvideo_enc: Check for integer overflow in ff_mpv_reallocate_putbitbuffer()
|
||||
- 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()
|
||||
- mov: Add an option to toggle dref opening
|
||||
- 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/aacenc: Check both channels for finiteness
|
||||
- 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
|
||||
- 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
|
||||
version <next>:
|
||||
|
||||
version 2.5.10
|
||||
- configure: bump copyright year to 2016
|
||||
- avformat/hls: Even stricter URL checks
|
||||
- avformat/hls: More strict url checks
|
||||
- swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
|
||||
- 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
|
||||
- avfilter/vf_scale: set proper out frame color 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
|
||||
- mjpegdec: extend check for incompatible values of s->rgb and s->ls
|
||||
- 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
|
||||
- avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec
|
||||
- avformat/matroskaenc: Check codecdelay before use
|
||||
- avutil/mathematics: Fix division by 0
|
||||
- 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
|
||||
- ffmdec: reject zero-sized chunks
|
||||
- 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.5.9
|
||||
- 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/ffv1dec: Clear quant_table_count if its invalid
|
||||
- avcodec/ffv1dec: Print an error if the quant table count is invalid
|
||||
- doc/filters/drawtext: fix centering example
|
||||
- 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
|
||||
- opusdec: Don't run vector_fmul_scalar on zero length arrays
|
||||
- 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/mpeg12dec: Set dimensions in mpeg1_decode_sequence() only in absence of errors
|
||||
- avcodec/libopusenc: Fix infinite loop on flushing after 0 input
|
||||
- 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
|
||||
- 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()
|
||||
- mxfdec: check edit_rate also for physical_track
|
||||
- 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
|
||||
- riffdec: prevent negative bit rate
|
||||
- Merge commit 'd80811c94e068085aab797f9ba35790529126f85'
|
||||
- imc: use correct position for flcoeffs2 calculation
|
||||
- wavpack: limit extra_bits to 32 and use get_bits_long
|
||||
- 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
|
||||
- avcodec/s302m: Only set the sample rate when some data is output
|
||||
- vp9: add support for resolution changes in inter frames.
|
||||
- alsdec: limit avctx->bits_per_raw_sample to 32
|
||||
- vp9: avoid infinite loop with broken files
|
||||
- videodsp: don't overread edges in vfix3 emu_edge.
|
||||
- avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
|
||||
- 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: separate slice_count from max_slice_count
|
||||
- lavf/img2dec: Fix memory leak
|
||||
- avcodec/mp3: fix skipping zeros
|
||||
- avformat/srtdec: make sure we probe a number
|
||||
- avformat/srtdec: more lenient first line probing
|
||||
- doc: mention libavcodec can decode Opus natively
|
||||
- MAINTAINERS: Remove myself as leader
|
||||
|
||||
|
||||
version 2.5.8
|
||||
- snow: remove an obsolete av_assert2
|
||||
- huffyuvdec: validate image size
|
||||
- vc1dec: use get_bits_long and limit the read bits to 32
|
||||
- mpegaudiodec: copy AVFloatDSPContext from first context to all contexts
|
||||
- libshine: fix support for shine 3.0
|
||||
- avidec: check for valid bit_rate range
|
||||
- avformat/nut: support WavPack
|
||||
- avcodec/diracdec: Check slices malloc and propagate error code
|
||||
- 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 crash with ost->last_frame allocation failure
|
||||
- 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: Check values before updating context in decode_fctl_chunk()
|
||||
- avcodec/pngdec: Require a IHDR chunk before fctl
|
||||
- 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
|
||||
- ffmpeg: Free last_frame instead of just unref
|
||||
- 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
|
||||
- libavutil/softfloat: Fix av_normalize1_sf bias.
|
||||
- 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
|
||||
- libopenjpegenc: add NULL check for img before accessing it
|
||||
- swresample: Check the return value of resampler->init()
|
||||
- h264: Make sure reinit failures mark the context as not initialized
|
||||
- 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
|
||||
- avformat/swfdec: Do not error out on pixel format changes
|
||||
- avfilter/x86/vf_hqdn3d: Fix register types
|
||||
- avcodec/mjpegenc_common: Use ff_mpv_reallocate_putbitbuffer()
|
||||
- avcodec/mpegvideo: Factor ff_mpv_reallocate_putbitbuffer() out
|
||||
- avformat/mov: Mark avio context of decompressed atoms as seekable
|
||||
- avcodec/hevc_ps: Only discard overread VPS if a previous is available
|
||||
- avcodec/x86/h264_weight: handle weight1=128
|
||||
- avcodec/exr: fix crash caused by merge
|
||||
|
||||
|
||||
version 2.5.7
|
||||
- avformat/nutdec: Fix recovery when immedeately after seeking a failure happens
|
||||
- nutdec: fix memleaks on error in nut_read_header
|
||||
- rtpenc_jpeg: handle case of picture dimensions not dividing by 8
|
||||
- avformat/mov: Fix parsing short loci
|
||||
- avcodec/shorten: Fix code depending on signed overflow behavior
|
||||
- avcodec/proresdec2: Reset slice_count on deallocation
|
||||
- ffmpeg_opt: Fix -timestamp parsing
|
||||
- hevc: make avcodec_decode_video2() fail if get_format() fails
|
||||
- avcodec/mpeg4audio: add some padding/alignment to MAX_PCE_SIZE
|
||||
- swr: fix alignment issue caused by 8ch sse functions
|
||||
- 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.
|
||||
- aacdec: don't return frames without data
|
||||
- avformat/matroskadec: Cleanup error handling for bz2 & zlib
|
||||
- avformat/nutdec: Fix use of uinitialized value
|
||||
- tools/graph2dot: use larger data types than int for array/string sizes
|
||||
- id3v2: catch avio_read errors in check_tag
|
||||
- aacsbr: break infinite loop in sbr_hf_calc_npatches
|
||||
- diracdec: avoid overflow of bytes*8 in decode_lowdelay
|
||||
- diracdec: prevent overflow in data_unit_size check
|
||||
- avidec: avoid infinite loop due to negative ast->sample_size
|
||||
- pngdec: don't use AV_PIX_FMT_MONOBLACK for apng
|
||||
- avcodec/wavpack: Check L/R values before use to avoid harmless integer overflow and undefined behavior in fate
|
||||
- xcbgrab: Validate the capture area
|
||||
- xcbgrab: Do not assume the non shm image data is always available
|
||||
- avfilter/lavfutils: disable frame threads when decoding a single image
|
||||
- nutdec: fix illegal count check in decode_main_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
|
||||
- swscale/ppc/swscale_altivec.c: POWER LE support in yuv2planeX_8() delete macro GET_VF()
|
||||
- libvpxenc: only set noise reduction w/vp8
|
||||
- tests/fate-run: do not attempt to parse tiny_psnrs output if it failed
|
||||
- alac: reject rice_limit 0 if compression is used
|
||||
- alsdec: only adapt order for positive max_order
|
||||
- alsdec: check sample pointer range in revert_channel_correlation
|
||||
- tests: drop bc dependency
|
||||
- fate: Include branch information in the payload header
|
||||
|
||||
|
||||
version 2.5.6
|
||||
- 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
|
||||
- msrledec: use signed pixel_ptr in msrle_decode_pal4
|
||||
- swresample: Allow reinitialization without ever setting channel layouts (cherry picked from commit 80a28c7509a11114e1aea5b208d56c6646d69c07)
|
||||
- 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
|
||||
- avcodec/h264: finish previous slices before switching to single thread mode
|
||||
- avcodec/h264: Fix race between slices where one overwrites data from the next
|
||||
- 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
|
||||
- avcodec/msrledec: restructure msrle_decode_pal4() based on the line number instead of the pixel pointer
|
||||
|
||||
|
||||
version 2.5.5:
|
||||
- vp9: make above buffer pointer 32-byte aligned.
|
||||
- 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()
|
||||
- avformat/mov: Use sizeof(filename) instead of a literal number
|
||||
- eac3dec: fix scaling
|
||||
- ac3_fixed: fix computation of spx_noise_blend
|
||||
- ac3_fixed: fix out-of-bound read
|
||||
- ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext
|
||||
- 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
|
||||
- ffmdec: initialize f_cprv, f_stvi and f_stau
|
||||
- avformat/rm: limit packet size
|
||||
- avcodec/webp: validate the distance prefix code
|
||||
- avcodec/rv10: check size of s->mb_width * s->mb_height
|
||||
- eamad: check for out of bounds read
|
||||
- mdec: check for out of bounds read
|
||||
- arm: Suppress tags about used cpu arch and extensions
|
||||
- aic: Fix decoding files with odd dimensions
|
||||
- avcodec/tiff: move bpp check to after "end:"
|
||||
- mxfdec: Fix the error handling for when strftime fails
|
||||
- avcodec/opusdec: Fix delayed sample value
|
||||
- avcodec/opusdec: Clear out pointers per packet
|
||||
- avcodec/utils: Align YUV411 by as much as the other YUV variants
|
||||
- vp9: fix segmentation map retention with threading enabled.
|
||||
- webp: ensure that each transform is only used once
|
||||
- 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/flvenc: check that the codec_tag fits in the available bits
|
||||
- avcodec/utils: use correct printf specifier in ff_set_sar
|
||||
- avutil/imgutils: correctly check for negative SAR components
|
||||
- swscale/utils: clear formatConvBuffer on allocation
|
||||
- avformat/bit: only accept the g729 codec and 1 channel
|
||||
- avformat/bit: check that pkt->size is 10 in write_packet
|
||||
- avformat/adxdec: check avctx->channels for invalid values
|
||||
- avformat/adxdec: set avctx->channels in adx_read_header
|
||||
- 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/h264: Only reinit quant tables if a new PPS is allowed
|
||||
- avcodec/snowdec: Fix ref value check
|
||||
- swscale/utils: More carefully merge and clear coefficients outside the input
|
||||
- avcodec/a64multienc: Assert that the Packet size does not grow
|
||||
- avcodec/a64multienc: simplify frame handling code
|
||||
- avcodec/a64multienc: fix use of uninitialized values in to_meta_with_crop
|
||||
- avcodec/a64multienc: initialize mc_meta_charset to zero
|
||||
- avcodec/a64multienc: don't set incorrect packet size
|
||||
- avcodec/a64multienc: use av_frame_ref instead of copying the frame
|
||||
- avcodec/x86/mlpdsp_init: Simplify mlp_filter_channel_x86()
|
||||
- h264: initialize H264Context.avctx in init_thread_copy
|
||||
- wtvdec: fix integer overflow resulting in errors with large files
|
||||
- avcodec/gif: fix off by one in column offsetting finding
|
||||
|
||||
|
||||
version 2.5.4:
|
||||
- avcodec/arm/videodsp_armv5te: Fix linking failure with shared libs
|
||||
- avcodec/mjpegdec: Skip blocks which are outside the visible area
|
||||
- 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
|
||||
- avcodec/ppc/idctdsp.c: POWER LE support in idct_add_altivec()
|
||||
- swscale/input: fix rgba64 alpha non native
|
||||
- swscale/input: Fix alpha of YA16 input
|
||||
- libavcodec/ppc/mpegvideoencdsp.c: fix stack smashing in pix_norm1_altivec() and pix_sum_altivec()
|
||||
- avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
|
||||
- avformat/mpeg: do not count PES packets inside PES packets during probing
|
||||
- hevc: always clip luma_log2_weight_denom
|
||||
- rtpdec_h263_rfc2190: Clear the stored bits if discarding buffered data
|
||||
- aacenc: correctly check returned value
|
||||
- swscale: check memory allocations
|
||||
- opt: check memory allocation
|
||||
- avformat/utils: check for malloc failure
|
||||
- avcodec/flac_parser: fix handling EOF if no headers are found
|
||||
- avfilter/vf_framepack: Check and update frame_rate
|
||||
- vp8: improve memory allocation checks
|
||||
- configure: enable vsx together with altivec for ppc64el
|
||||
- avcodec/hevc: Fix handling of skipped_bytes() reallocation failures
|
||||
- qpeg: avoid pointless invalid memcpy()
|
||||
|
||||
|
||||
version 2.5.3:
|
||||
- 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
|
||||
- cmdutils: Use 64bit for file size/offset related variable in cmdutils_read_file()
|
||||
- mov: Fix negative size calculation in mov_read_default().
|
||||
- avformat/mov: fix integer overflow in mov_read_udta_string()
|
||||
- mov: Fix overflow and error handling in read_tfra().
|
||||
- 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
|
||||
- libavformat: Build hevc.o when building the RTP muxer
|
||||
|
||||
version 2.5.2:
|
||||
- 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/xface: correct the XFACE_MAX_* values
|
||||
- avcodec/vmdvideo: Check len before using it in method 3
|
||||
- configure: create the tests directory like the doc directory
|
||||
- mmvideo: check frame dimensions
|
||||
- jvdec: check frame dimensions
|
||||
|
||||
version 2.5.1:
|
||||
- lavu/frame: fix malloc error path in av_frame_copy_props()
|
||||
- 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/crypto: fix key vs iv typo
|
||||
- configure: use use_pkg_config() instead of check_pkg_config() for libsmbclient
|
||||
- avcodec/ppc/vp3dsp_altivec: POWER LE support to vp3_idct_add_altivec()
|
||||
- avformat/matroskadec: fix handling of recursive SeekHead elements
|
||||
- doc/examples/filtering_video: fix frame rate
|
||||
- avcodec/mpegaudiodec_template: only allocate fdsp when its used
|
||||
- doc/examples/transcoding: check encoder before using it
|
||||
- update MAINTAINERS file
|
||||
- POWER LE support in put_vp8_epel_h_altivec_core() put_vp8_epel_v_altivec_core() put_vp8_pixels16_altivec()
|
||||
- POWER LE support in vc1_inv_trans_8x4_altivec()
|
||||
|
||||
version 2.5:
|
||||
- HEVC/H.265 RTP payload format (draft v6) packetizer
|
||||
- SUP/PGS subtitle demuxer
|
||||
- ffprobe -show_pixel_formats option
|
||||
- CAST128 symmetric block cipher, ECB mode
|
||||
- STL subtitle demuxer and decoder
|
||||
- libutvideo YUV 4:2:2 10bit support
|
||||
- XCB-based screen-grabber
|
||||
- UDP-Lite support (RFC 3828)
|
||||
- xBR scaling filter
|
||||
- AVFoundation screen capturing support
|
||||
- ffserver supports codec private options
|
||||
- creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
|
||||
- WebP muxer with animated WebP support
|
||||
- zygoaudio decoding support
|
||||
- APNG decoder and demuxer
|
||||
- postproc visualization support
|
||||
version 2.4.1:
|
||||
- swsscale: 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:
|
||||
|
@@ -64,7 +64,6 @@ There are a handful of files under other licensing terms, namely:
|
||||
documentation accompanying your program if you only distribute executables.
|
||||
You must also indicate any changes including additions and deletions to
|
||||
those three files in the documentation.
|
||||
tests/reference.pnm is under the expat license
|
||||
|
||||
|
||||
external libraries
|
||||
|
11
MAINTAINERS
11
MAINTAINERS
@@ -14,6 +14,7 @@ patches and related discussions.
|
||||
Project Leader
|
||||
==============
|
||||
|
||||
Michael Niedermayer
|
||||
final design decisions
|
||||
|
||||
|
||||
@@ -308,7 +309,6 @@ libavdevice
|
||||
|
||||
|
||||
avfoundation.m Thilo Borgmann
|
||||
decklink* Deti Fliegl
|
||||
dshow.c Roger Pack (CC rogerdpack@gmail.com)
|
||||
fbdev_enc.c Lukasz Marek
|
||||
gdigrab.c Roger Pack (CC rogerdpack@gmail.com)
|
||||
@@ -385,7 +385,6 @@ Muxers/Demuxers:
|
||||
aiffdec.c Baptiste Coudurier, Matthieu Bouron
|
||||
aiffenc.c Baptiste Coudurier, Matthieu Bouron
|
||||
ape.c Kostya Shishkov
|
||||
apngdec.c Benoit Fouet
|
||||
ass* Aurelien Jacobs
|
||||
astdec.c Paul B Mahol
|
||||
astenc.c James Almer
|
||||
@@ -463,7 +462,7 @@ Muxers/Demuxers:
|
||||
rtmp* Kostya Shishkov
|
||||
rtp.c, rtpenc.c Martin Storsjo
|
||||
rtpdec_h261.*, rtpenc_h261.* Thomas Volkert
|
||||
rtpdec_hevc.*, rtpenc_hevc.* Thomas Volkert
|
||||
rtpdec_hevc.* Thomas Volkert
|
||||
rtpdec_asf.* Ronald S. Bultje
|
||||
rtpenc_mpv.*, rtpenc_aac.* Martin Storsjo
|
||||
rtsp.c Luca Barbato
|
||||
@@ -497,7 +496,6 @@ Protocols:
|
||||
libssh.c Lukasz Marek
|
||||
mms*.c Ronald S. Bultje
|
||||
udp.c Luca Abeni
|
||||
icecast.c Marvin Scholz
|
||||
|
||||
|
||||
libswresample
|
||||
@@ -531,13 +529,14 @@ Windows ICL Matthew Oliver
|
||||
ADI/Blackfin DSP Marc Hoffman
|
||||
Sparc Roman Shaposhnik
|
||||
x86 Michael Niedermayer
|
||||
OS/2 KO Myung-Hun
|
||||
|
||||
|
||||
Releases
|
||||
========
|
||||
|
||||
2.5 Michael Niedermayer
|
||||
2.4 Michael Niedermayer
|
||||
2.2 Michael Niedermayer
|
||||
1.2 Michael Niedermayer
|
||||
|
||||
If you want to maintain an older release, please contact us
|
||||
|
||||
|
3
Makefile
3
Makefile
@@ -32,7 +32,6 @@ OBJS-ffmpeg += ffmpeg_opt.o ffmpeg_filter.o
|
||||
OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
|
||||
OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
|
||||
OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_vda.o
|
||||
OBJS-ffserver += ffserver_config.o
|
||||
|
||||
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
|
||||
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
|
||||
@@ -112,7 +111,7 @@ 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) $< $@
|
||||
|
@@ -32,7 +32,7 @@ and in the [wiki](http://trac.ffmpeg.org).
|
||||
|
||||
### Examples
|
||||
|
||||
Coding examples are available in the **doc/examples** directory.
|
||||
Conding examples are available in the **doc/example** directory.
|
||||
|
||||
## License
|
||||
|
||||
|
106
RELEASE_NOTES
106
RELEASE_NOTES
@@ -1,14 +1,16 @@
|
||||
┌────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 2.5 "Bohr" │
|
||||
│ RELEASE NOTES for FFmpeg 2.4 "Fresnel" │
|
||||
└────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 2.5 "Bohr", 2.5 months after the
|
||||
release of 2.4.
|
||||
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 most important new features are AVFoundation screen-grabbing support,
|
||||
animated WebP decoding support, and Animated PNG support. In addition, many
|
||||
exciting features for video streaming are also implemented, including MPEG-
|
||||
DASH fragmenting muxer, HEVC RTP payload muxer, and UDP Lite support.
|
||||
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.
|
||||
|
||||
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
|
||||
@@ -18,21 +20,24 @@
|
||||
│ 🔨 API Information │
|
||||
└────────────────────────────┘
|
||||
|
||||
FFmpeg 2.5 includes the following library versions:
|
||||
FFmpeg 2.4 includes the following library versions:
|
||||
|
||||
• libavutil 54.15.100
|
||||
• libavcodec 56.13.100
|
||||
• libavformat 56.15.102
|
||||
• libavdevice 56. 3.100
|
||||
• libavfilter 5. 2.103
|
||||
• libswscale 3. 1.101
|
||||
• libswresample 1. 1.100
|
||||
• libpostproc 53. 3.100
|
||||
• 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
|
||||
|
||||
Important API changes since 2.4:
|
||||
|
||||
• avpriv_dv_frame_profile2() has been deprecated
|
||||
Important API changes since 2.3:
|
||||
|
||||
• 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.
|
||||
|
||||
Please refer to the doc/APIchanges file for more information.
|
||||
|
||||
@@ -40,62 +45,39 @@
|
||||
│ ★ List of New Features │
|
||||
└────────────────────────────┘
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ ffprobe │
|
||||
└────────────────────────────┘
|
||||
|
||||
• -show_pixel_formats option
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ ffserver │
|
||||
└────────────────────────────┘
|
||||
|
||||
• codec private options support
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libavcodec │
|
||||
└────────────────────────────┘
|
||||
|
||||
• STL subtitle decoder
|
||||
• libutvideo YUV 4:2:2 10bit support
|
||||
• animated WebP decoding support
|
||||
• zygoaudio decoding support
|
||||
• APNG decoder
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libavdevice │
|
||||
└────────────────────────────┘
|
||||
|
||||
• XCB-based screen-grabber
|
||||
• AVFoundation screen capturing support
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libavformat │
|
||||
└────────────────────────────┘
|
||||
|
||||
• HEVC/H.265 RTP payload format (draft v6) packetizer
|
||||
• SUP/PGS subtitle demuxer
|
||||
• STL subtitle demuxer
|
||||
• UDP-Lite support (RFC 3828)
|
||||
• MPEG-DASH segmenting muxer, which allows creating DASH compatible
|
||||
fragmented MP4
|
||||
• WebP muxer
|
||||
• APNG demuxer
|
||||
• 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
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libavfilter │
|
||||
└────────────────────────────┘
|
||||
|
||||
• xBR scaling filter
|
||||
• 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 │
|
||||
└────────────────────────────┘
|
||||
|
||||
• CAST128 symmetric block cipher, ECB mode
|
||||
• Added clip() function in eval.
|
||||
|
||||
┌────────────────────────────┐
|
||||
│ libpostproc │
|
||||
└────────────────────────────┘
|
||||
┌────────────────────────────┐
|
||||
│ ⚠ Behaviour changes │
|
||||
└────────────────────────────┘
|
||||
|
||||
• visualization support
|
||||
• 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
|
||||
|
204
cmdutils.c
204
cmdutils.c
@@ -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;
|
||||
@@ -959,10 +959,9 @@ static int init_report(const char *env)
|
||||
|
||||
report_file = fopen(filename.str, "w");
|
||||
if (!report_file) {
|
||||
int ret = AVERROR(errno);
|
||||
av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n",
|
||||
filename.str, strerror(errno));
|
||||
return ret;
|
||||
return AVERROR(errno);
|
||||
}
|
||||
av_log_set_callback(log_callback_report);
|
||||
av_log(NULL, AV_LOG_INFO,
|
||||
@@ -1544,8 +1543,7 @@ int show_protocols(void *optctx, const char *opt, const char *arg)
|
||||
|
||||
int show_filters(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
#if CONFIG_AVFILTER
|
||||
const AVFilter *filter = NULL;
|
||||
const AVFilter av_unused(*filter) = NULL;
|
||||
char descr[64], *descr_cur;
|
||||
int i, j;
|
||||
const AVFilterPad *pad;
|
||||
@@ -1558,6 +1556,7 @@ int show_filters(void *optctx, const char *opt, const char *arg)
|
||||
" V = Video input/output\n"
|
||||
" N = Dynamic number and/or type of input/output\n"
|
||||
" | = Source or sink filter\n");
|
||||
#if CONFIG_AVFILTER
|
||||
while ((filter = avfilter_next(filter))) {
|
||||
descr_cur = descr;
|
||||
for (i = 0; i < 2; i++) {
|
||||
@@ -1582,8 +1581,6 @@ int show_filters(void *optctx, const char *opt, const char *arg)
|
||||
filter->process_command ? 'C' : '.',
|
||||
filter->name, descr, filter->description);
|
||||
}
|
||||
#else
|
||||
printf("No filters available: libavfilter disabled\n");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -1860,23 +1857,21 @@ 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) {
|
||||
ret = AVERROR(errno);
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename,
|
||||
strerror(errno));
|
||||
return ret;
|
||||
return AVERROR(errno);
|
||||
}
|
||||
fseek(f, 0, SEEK_END);
|
||||
*size = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
if (*size == (size_t)-1) {
|
||||
ret = AVERROR(errno);
|
||||
av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", strerror(errno));
|
||||
fclose(f);
|
||||
return ret;
|
||||
return AVERROR(errno);
|
||||
}
|
||||
*bufptr = av_malloc(*size + 1);
|
||||
if (!*bufptr) {
|
||||
@@ -1888,9 +1883,9 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
||||
if (ret < *size) {
|
||||
av_free(*bufptr);
|
||||
if (ferror(f)) {
|
||||
ret = AVERROR(errno);
|
||||
av_log(NULL, AV_LOG_ERROR, "Error while reading file '%s': %s\n",
|
||||
filename, strerror(errno));
|
||||
ret = AVERROR(errno);
|
||||
} else
|
||||
ret = AVERROR_EOF;
|
||||
} else {
|
||||
@@ -1997,7 +1992,7 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
|
||||
switch (check_stream_specifier(s, st, p + 1)) {
|
||||
case 1: *p = 0; break;
|
||||
case 0: continue;
|
||||
default: exit_program(1);
|
||||
default: return NULL;
|
||||
}
|
||||
|
||||
if (av_opt_find(&cc, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ) ||
|
||||
@@ -2055,184 +2050,3 @@ void *grow_array(void *array, int elem_size, int *size, int new_size)
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
#if CONFIG_AVDEVICE
|
||||
static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
|
||||
{
|
||||
int ret, i;
|
||||
AVFormatContext *dev = NULL;
|
||||
AVDeviceInfoList *device_list = NULL;
|
||||
AVDictionary *tmp_opts = NULL;
|
||||
|
||||
if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category))
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
printf("Audo-detected sources for %s:\n", fmt->name);
|
||||
if (!fmt->get_device_list) {
|
||||
ret = AVERROR(ENOSYS);
|
||||
printf("Cannot list sources. Not implemented.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* TODO: avformat_open_input calls read_header callback which is not necessary.
|
||||
Function like avformat_alloc_output_context2 for input could be helpful here. */
|
||||
av_dict_copy(&tmp_opts, opts, 0);
|
||||
if ((ret = avformat_open_input(&dev, NULL, fmt, &tmp_opts)) < 0) {
|
||||
printf("Cannot open device: %s.\n", fmt->name);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((ret = avdevice_list_devices(dev, &device_list)) < 0) {
|
||||
printf("Cannot list sources.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < device_list->nb_devices; i++) {
|
||||
printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ",
|
||||
device_list->devices[i]->device_name, device_list->devices[i]->device_description);
|
||||
}
|
||||
|
||||
fail:
|
||||
av_dict_free(&tmp_opts);
|
||||
avdevice_free_list_devices(&device_list);
|
||||
avformat_close_input(&dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
|
||||
{
|
||||
int ret, i;
|
||||
AVFormatContext *dev = NULL;
|
||||
AVDeviceInfoList *device_list = NULL;
|
||||
AVDictionary *tmp_opts = NULL;
|
||||
|
||||
if (!fmt || !fmt->priv_class || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category))
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
printf("Audo-detected sinks for %s:\n", fmt->name);
|
||||
if (!fmt->get_device_list) {
|
||||
ret = AVERROR(ENOSYS);
|
||||
printf("Cannot list sinks. Not implemented.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((ret = avformat_alloc_output_context2(&dev, fmt, NULL, NULL)) < 0) {
|
||||
printf("Cannot open device: %s.\n", fmt->name);
|
||||
goto fail;
|
||||
}
|
||||
av_dict_copy(&tmp_opts, opts, 0);
|
||||
av_opt_set_dict2(dev, &tmp_opts, AV_OPT_SEARCH_CHILDREN);
|
||||
|
||||
if ((ret = avdevice_list_devices(dev, &device_list)) < 0) {
|
||||
printf("Cannot list sinks.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < device_list->nb_devices; i++) {
|
||||
printf("%s %s [%s]\n", device_list->default_device == i ? "*" : " ",
|
||||
device_list->devices[i]->device_name, device_list->devices[i]->device_description);
|
||||
}
|
||||
|
||||
fail:
|
||||
av_dict_free(&tmp_opts);
|
||||
avdevice_free_list_devices(&device_list);
|
||||
avformat_free_context(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int show_sinks_sources_parse_arg(const char *arg, char **dev, AVDictionary **opts)
|
||||
{
|
||||
int ret;
|
||||
if (arg) {
|
||||
char *opts_str = NULL;
|
||||
av_assert0(dev && opts);
|
||||
*dev = av_strdup(arg);
|
||||
if (!*dev)
|
||||
return AVERROR(ENOMEM);
|
||||
if ((opts_str = strchr(*dev, ','))) {
|
||||
*(opts_str++) = '\0';
|
||||
if (opts_str[0] && ((ret = av_dict_parse_string(opts, opts_str, "=", ":", 0)) < 0)) {
|
||||
av_freep(dev);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
} else
|
||||
printf("\nDevice name is not provided.\n"
|
||||
"You can pass devicename[,opt1=val1[,opt2=val2...]] as an argument.\n\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int show_sources(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
AVInputFormat *fmt = NULL;
|
||||
char *dev = NULL;
|
||||
AVDictionary *opts = NULL;
|
||||
int ret = 0;
|
||||
int error_level = av_log_get_level();
|
||||
|
||||
av_log_set_level(AV_LOG_ERROR);
|
||||
|
||||
if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0)
|
||||
goto fail;
|
||||
|
||||
do {
|
||||
fmt = av_input_audio_device_next(fmt);
|
||||
if (fmt) {
|
||||
if (!strcmp(fmt->name, "lavfi"))
|
||||
continue; //it's pointless to probe lavfi
|
||||
if (dev && strcmp(fmt->name, dev))
|
||||
continue;
|
||||
print_device_sources(fmt, opts);
|
||||
}
|
||||
} while (fmt);
|
||||
do {
|
||||
fmt = av_input_video_device_next(fmt);
|
||||
if (fmt) {
|
||||
if (dev && strcmp(fmt->name, dev))
|
||||
continue;
|
||||
print_device_sources(fmt, opts);
|
||||
}
|
||||
} while (fmt);
|
||||
fail:
|
||||
av_dict_free(&opts);
|
||||
av_free(dev);
|
||||
av_log_set_level(error_level);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int show_sinks(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
AVOutputFormat *fmt = NULL;
|
||||
char *dev = NULL;
|
||||
AVDictionary *opts = NULL;
|
||||
int ret = 0;
|
||||
int error_level = av_log_get_level();
|
||||
|
||||
av_log_set_level(AV_LOG_ERROR);
|
||||
|
||||
if ((ret = show_sinks_sources_parse_arg(arg, &dev, &opts)) < 0)
|
||||
goto fail;
|
||||
|
||||
do {
|
||||
fmt = av_output_audio_device_next(fmt);
|
||||
if (fmt) {
|
||||
if (dev && strcmp(fmt->name, dev))
|
||||
continue;
|
||||
print_device_sinks(fmt, opts);
|
||||
}
|
||||
} while (fmt);
|
||||
do {
|
||||
fmt = av_output_video_device_next(fmt);
|
||||
if (fmt) {
|
||||
if (dev && strcmp(fmt->name, dev))
|
||||
continue;
|
||||
print_device_sinks(fmt, opts);
|
||||
}
|
||||
} while (fmt);
|
||||
fail:
|
||||
av_dict_free(&opts);
|
||||
av_free(dev);
|
||||
av_log_set_level(error_level);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
14
cmdutils.h
14
cmdutils.h
@@ -443,20 +443,6 @@ int show_formats(void *optctx, const char *opt, const char *arg);
|
||||
*/
|
||||
int show_devices(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
#if CONFIG_AVDEVICE
|
||||
/**
|
||||
* Print a listing containing audodetected sinks of the output device.
|
||||
* Device name with options may be passed as an argument to limit results.
|
||||
*/
|
||||
int show_sinks(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Print a listing containing audodetected sources of the input device.
|
||||
* Device name with options may be passed as an argument to limit results.
|
||||
*/
|
||||
int show_sources(void *optctx, const char *opt, const char *arg);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Print a listing containing all the codecs supported by the
|
||||
* program.
|
||||
|
@@ -27,9 +27,3 @@
|
||||
{ "opencl_bench", OPT_EXIT, {.func_arg = opt_opencl_bench}, "run benchmark on all OpenCL devices and show results" },
|
||||
{ "opencl_options", HAS_ARG, {.func_arg = opt_opencl}, "set OpenCL environment options" },
|
||||
#endif
|
||||
#if CONFIG_AVDEVICE
|
||||
{ "sources" , OPT_EXIT | HAS_ARG, { .func_arg = show_sources },
|
||||
"list sources of the input device", "device" },
|
||||
{ "sinks" , OPT_EXIT | HAS_ARG, { .func_arg = show_sinks },
|
||||
"list sinks of the output device", "device" },
|
||||
#endif
|
||||
|
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
@@ -55,17 +55,35 @@ typedef struct pthread_t {
|
||||
* not mutexes */
|
||||
typedef CRITICAL_SECTION pthread_mutex_t;
|
||||
|
||||
/* This is the CONDITION_VARIABLE typedef for using Windows' native
|
||||
* conditional variables on kernels 6.0+. */
|
||||
#if HAVE_CONDITION_VARIABLE_PTR
|
||||
typedef CONDITION_VARIABLE pthread_cond_t;
|
||||
#else
|
||||
/* This is the CONDITIONAL_VARIABLE typedef for using Window's native
|
||||
* conditional variables on kernels 6.0+.
|
||||
* MinGW does not currently have this typedef. */
|
||||
typedef struct pthread_cond_t {
|
||||
void *Ptr;
|
||||
void *ptr;
|
||||
} pthread_cond_t;
|
||||
#endif
|
||||
|
||||
#if _WIN32_WINNT >= 0x0600
|
||||
/* function pointers to conditional variable API on windows 6.0+ kernels */
|
||||
#if _WIN32_WINNT < 0x0600
|
||||
static void (WINAPI *cond_broadcast)(pthread_cond_t *cond);
|
||||
static void (WINAPI *cond_init)(pthread_cond_t *cond);
|
||||
static void (WINAPI *cond_signal)(pthread_cond_t *cond);
|
||||
static BOOL (WINAPI *cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
DWORD milliseconds);
|
||||
#else
|
||||
#define cond_init InitializeConditionVariable
|
||||
#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
|
||||
@@ -118,36 +136,6 @@ static inline int pthread_mutex_unlock(pthread_mutex_t *m)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if _WIN32_WINNT >= 0x0600
|
||||
static inline int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
|
||||
{
|
||||
InitializeConditionVariable(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* native condition variables do not destroy */
|
||||
static inline void pthread_cond_destroy(pthread_cond_t *cond)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
{
|
||||
WakeAllConditionVariable(cond);
|
||||
}
|
||||
|
||||
static inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
|
||||
{
|
||||
SleepConditionVariableCS(cond, mutex, INFINITE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
WakeConditionVariable(cond);
|
||||
}
|
||||
|
||||
#else // _WIN32_WINNT < 0x0600
|
||||
/* for pre-Windows 6.0 platforms we need to define and use our own condition
|
||||
* variable and api */
|
||||
typedef struct win32_cond_t {
|
||||
@@ -159,13 +147,6 @@ typedef struct win32_cond_t {
|
||||
volatile int is_broadcast;
|
||||
} win32_cond_t;
|
||||
|
||||
/* function pointers to conditional variable API on windows 6.0+ kernels */
|
||||
static void (WINAPI *cond_broadcast)(pthread_cond_t *cond);
|
||||
static void (WINAPI *cond_init)(pthread_cond_t *cond);
|
||||
static void (WINAPI *cond_signal)(pthread_cond_t *cond);
|
||||
static BOOL (WINAPI *cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
DWORD milliseconds);
|
||||
|
||||
static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
|
||||
{
|
||||
win32_cond_t *win32_cond = NULL;
|
||||
@@ -178,7 +159,7 @@ static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_
|
||||
win32_cond = av_mallocz(sizeof(win32_cond_t));
|
||||
if (!win32_cond)
|
||||
return ENOMEM;
|
||||
cond->Ptr = win32_cond;
|
||||
cond->ptr = win32_cond;
|
||||
win32_cond->semaphore = CreateSemaphore(NULL, 0, 0x7fffffff, NULL);
|
||||
if (!win32_cond->semaphore)
|
||||
return ENOMEM;
|
||||
@@ -193,7 +174,7 @@ static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_
|
||||
|
||||
static av_unused void pthread_cond_destroy(pthread_cond_t *cond)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->Ptr;
|
||||
win32_cond_t *win32_cond = cond->ptr;
|
||||
/* native condition variables do not destroy */
|
||||
if (cond_init)
|
||||
return;
|
||||
@@ -204,12 +185,12 @@ static av_unused void pthread_cond_destroy(pthread_cond_t *cond)
|
||||
pthread_mutex_destroy(&win32_cond->mtx_waiter_count);
|
||||
pthread_mutex_destroy(&win32_cond->mtx_broadcast);
|
||||
av_freep(&win32_cond);
|
||||
cond->Ptr = NULL;
|
||||
cond->ptr = NULL;
|
||||
}
|
||||
|
||||
static av_unused void pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->Ptr;
|
||||
win32_cond_t *win32_cond = cond->ptr;
|
||||
int have_waiter;
|
||||
|
||||
if (cond_broadcast) {
|
||||
@@ -240,7 +221,7 @@ static av_unused void pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
|
||||
static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->Ptr;
|
||||
win32_cond_t *win32_cond = cond->ptr;
|
||||
int last_waiter;
|
||||
if (cond_wait) {
|
||||
cond_wait(cond, mutex, INFINITE);
|
||||
@@ -272,7 +253,7 @@ static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mu
|
||||
|
||||
static av_unused void pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
win32_cond_t *win32_cond = cond->Ptr;
|
||||
win32_cond_t *win32_cond = cond->ptr;
|
||||
int have_waiter;
|
||||
if (cond_signal) {
|
||||
cond_signal(cond);
|
||||
@@ -294,7 +275,6 @@ static av_unused void pthread_cond_signal(pthread_cond_t *cond)
|
||||
|
||||
pthread_mutex_unlock(&win32_cond->mtx_broadcast);
|
||||
}
|
||||
#endif
|
||||
|
||||
static av_unused void w32thread_init(void)
|
||||
{
|
||||
|
238
configure
vendored
238
configure
vendored
@@ -251,22 +251,17 @@ External library support:
|
||||
--enable-libx264 enable H.264 encoding via x264 [no]
|
||||
--enable-libx265 enable HEVC encoding via x265 [no]
|
||||
--enable-libxavs enable AVS encoding via xavs [no]
|
||||
--enable-libxcb enable X11 grabbing using XCB [auto]
|
||||
--enable-libxcb-shm enable X11 grabbing shm communication [auto]
|
||||
--enable-libxcb-xfixes enable X11 grabbing mouse rendering [auto]
|
||||
--enable-libxcb-shape enable X11 grabbing shape rendering [auto]
|
||||
--enable-libxvid enable Xvid encoding via xvidcore,
|
||||
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 I/O support [no]
|
||||
--enable-decklink enable Blackmagick DeckLink output [no]
|
||||
--enable-openal enable OpenAL 1.1 capture support [no]
|
||||
--enable-opencl enable OpenCL code
|
||||
--enable-opengl enable OpenGL rendering [no]
|
||||
--enable-openssl enable openssl [no]
|
||||
--disable-sdl disable sdl [autodetect]
|
||||
--enable-x11grab enable X11 grabbing (legacy) [no]
|
||||
--enable-x11grab enable X11 grabbing [no]
|
||||
--disable-xlib disable xlib [autodetect]
|
||||
--disable-zlib disable zlib [autodetect]
|
||||
|
||||
@@ -1203,17 +1198,13 @@ require_cpp(){
|
||||
check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
|
||||
}
|
||||
|
||||
use_pkg_config(){
|
||||
require_pkg_config(){
|
||||
pkg="$1"
|
||||
check_pkg_config "$@" || return 1
|
||||
check_pkg_config "$@" || die "ERROR: $pkg not found"
|
||||
add_cflags $(get_safe ${pkg}_cflags)
|
||||
add_extralibs $(get_safe ${pkg}_libs)
|
||||
}
|
||||
|
||||
require_pkg_config(){
|
||||
use_pkg_config "$@" || die "ERROR: $pkg not found using pkg-config$pkg_config_fail_message"
|
||||
}
|
||||
|
||||
require_libfreetype(){
|
||||
log require_libfreetype "$@"
|
||||
pkg="freetype2"
|
||||
@@ -1389,10 +1380,6 @@ EXTERNAL_LIBRARY_LIST="
|
||||
libx264
|
||||
libx265
|
||||
libxavs
|
||||
libxcb
|
||||
libxcb_shm
|
||||
libxcb_shape
|
||||
libxcb_xfixes
|
||||
libxvid
|
||||
libzmq
|
||||
libzvbi
|
||||
@@ -1401,7 +1388,6 @@ EXTERNAL_LIBRARY_LIST="
|
||||
opencl
|
||||
opengl
|
||||
openssl
|
||||
sdl
|
||||
x11grab
|
||||
xlib
|
||||
zlib
|
||||
@@ -1608,7 +1594,6 @@ ARCH_FEATURES="
|
||||
|
||||
BUILTIN_LIST="
|
||||
atomic_cas_ptr
|
||||
atomic_compare_exchange
|
||||
machine_rw_barrier
|
||||
MemoryBarrier
|
||||
mm_empty
|
||||
@@ -1635,6 +1620,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
|
||||
@@ -1664,7 +1650,6 @@ HEADERS_LIST="
|
||||
sys_un_h
|
||||
sys_videoio_h
|
||||
termios_h
|
||||
udplite_h
|
||||
unistd_h
|
||||
windows_h
|
||||
winsock2_h
|
||||
@@ -1683,6 +1668,7 @@ MATH_FUNCS="
|
||||
exp2
|
||||
exp2f
|
||||
expf
|
||||
fminf
|
||||
isinf
|
||||
isnan
|
||||
ldexpf
|
||||
@@ -1726,7 +1712,6 @@ SYSTEM_FUNCS="
|
||||
gettimeofday
|
||||
glob
|
||||
glXGetProcAddress
|
||||
gmtime_r
|
||||
inet_aton
|
||||
isatty
|
||||
jack_port_get_latency_range
|
||||
@@ -1735,7 +1720,6 @@ SYSTEM_FUNCS="
|
||||
lzo1x_999_compress
|
||||
mach_absolute_time
|
||||
MapViewOfFile
|
||||
MoveFileExA
|
||||
memalign
|
||||
mkstemp
|
||||
mmap
|
||||
@@ -1760,7 +1744,6 @@ SYSTEM_FUNCS="
|
||||
TOOLCHAIN_FEATURES="
|
||||
as_dn_directive
|
||||
as_func
|
||||
as_object_arch
|
||||
asm_mod_q
|
||||
attribute_may_alias
|
||||
attribute_packed
|
||||
@@ -1782,7 +1765,6 @@ TOOLCHAIN_FEATURES="
|
||||
"
|
||||
|
||||
TYPES_LIST="
|
||||
CONDITION_VARIABLE_Ptr
|
||||
socklen_t
|
||||
struct_addrinfo
|
||||
struct_group_source_req
|
||||
@@ -2036,7 +2018,7 @@ simd_align_16_if_any="altivec neon sse"
|
||||
symver_if_any="symver_asm_label symver_gnu_asm"
|
||||
|
||||
# threading support
|
||||
atomics_gcc_if_any="sync_val_compare_and_swap atomic_compare_exchange"
|
||||
atomics_gcc_if="sync_val_compare_and_swap"
|
||||
atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
|
||||
atomics_win32_if="MemoryBarrier"
|
||||
atomics_native_if_any="$ATOMICS_LIST"
|
||||
@@ -2075,7 +2057,6 @@ amrwb_decoder_select="lsp"
|
||||
amv_decoder_select="sp5x_decoder exif"
|
||||
amv_encoder_select="aandcttables mpegvideoenc"
|
||||
ape_decoder_select="bswapdsp llauddsp"
|
||||
apng_decoder_select="zlib"
|
||||
asv1_decoder_select="blockdsp bswapdsp idctdsp"
|
||||
asv1_encoder_select="bswapdsp fdctdsp pixblockdsp"
|
||||
asv2_decoder_select="blockdsp bswapdsp idctdsp"
|
||||
@@ -2405,7 +2386,6 @@ avi_muxer_select="riffenc"
|
||||
avisynth_demuxer_deps="avisynth"
|
||||
avisynth_demuxer_select="riffdec"
|
||||
caf_demuxer_select="riffdec"
|
||||
dash_muxer_select="mp4_muxer"
|
||||
dirac_demuxer_select="dirac_parser"
|
||||
dts_demuxer_select="dca_parser"
|
||||
dtshd_demuxer_select="dca_parser"
|
||||
@@ -2430,7 +2410,7 @@ matroska_muxer_select="riffenc"
|
||||
mmf_muxer_select="riffenc"
|
||||
mov_demuxer_select="riffdec"
|
||||
mov_demuxer_suggest="zlib"
|
||||
mov_muxer_select="riffenc rtpenc_chain ac3_parser"
|
||||
mov_muxer_select="riffenc rtpenc_chain"
|
||||
mp3_demuxer_select="mpegaudio_parser"
|
||||
mp4_muxer_select="mov_muxer"
|
||||
mpegts_muxer_select="adts_muxer latm_muxer"
|
||||
@@ -2469,14 +2449,12 @@ xwma_demuxer_select="riffdec"
|
||||
# indevs / outdevs
|
||||
alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
|
||||
alsa_outdev_deps="alsa_asoundlib_h"
|
||||
avfoundation_indev_extralibs="-framework CoreVideo -framework Foundation -framework AVFoundation -framework CoreMedia -framework CoreGraphics"
|
||||
avfoundation_indev_extralibs="-framework CoreVideo -framework Foundation -framework AVFoundation -framework CoreMedia"
|
||||
avfoundation_indev_select="avfoundation"
|
||||
bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
|
||||
caca_outdev_deps="libcaca"
|
||||
decklink_outdev_deps="decklink pthreads"
|
||||
decklink_outdev_extralibs="-lstdc++"
|
||||
decklink_indev_deps="decklink pthreads"
|
||||
decklink_indev_extralibs="-lstdc++"
|
||||
dshow_indev_deps="IBaseFilter"
|
||||
dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
|
||||
dv1394_indev_deps="dv1394"
|
||||
@@ -2511,7 +2489,6 @@ vfwcap_indev_extralibs="-lavicap32"
|
||||
xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
|
||||
xv_outdev_extralibs="-lXv -lX11 -lXext"
|
||||
x11grab_indev_deps="x11grab"
|
||||
x11grab_xcb_indev_deps="libxcb"
|
||||
|
||||
# protocols
|
||||
bluray_protocol_deps="libbluray"
|
||||
@@ -2551,11 +2528,11 @@ tcp_protocol_select="network"
|
||||
tls_protocol_deps_any="openssl gnutls"
|
||||
tls_protocol_select="tcp_protocol"
|
||||
udp_protocol_select="network"
|
||||
udplite_protocol_select="network"
|
||||
unix_protocol_deps="sys_un_h"
|
||||
unix_protocol_select="network"
|
||||
|
||||
# filters
|
||||
aconvert_filter_deps="swresample"
|
||||
amovie_filter_deps="avcodec avformat"
|
||||
aresample_filter_deps="swresample"
|
||||
ass_filter_deps="libass"
|
||||
@@ -2574,16 +2551,19 @@ drawtext_filter_deps="libfreetype"
|
||||
ebur128_filter_deps="gpl"
|
||||
flite_filter_deps="libflite"
|
||||
frei0r_filter_deps="frei0r dlopen"
|
||||
frei0r_filter_extralibs='$ldl'
|
||||
frei0r_src_filter_deps="frei0r dlopen"
|
||||
frei0r_src_filter_extralibs='$ldl'
|
||||
geq_filter_deps="gpl"
|
||||
histeq_filter_deps="gpl"
|
||||
hqdn3d_filter_deps="gpl"
|
||||
interlace_filter_deps="gpl"
|
||||
kerndeint_filter_deps="gpl"
|
||||
ladspa_filter_deps="ladspa dlopen"
|
||||
ladspa_filter_extralibs='$ldl'
|
||||
mcdeint_filter_deps="avcodec gpl"
|
||||
movie_filter_deps="avcodec avformat"
|
||||
mp_filter_deps="gpl avcodec swscale"
|
||||
mp_filter_deps="gpl avcodec swscale inline_asm"
|
||||
mpdecimate_filter_deps="gpl"
|
||||
mpdecimate_filter_select="pixelutils"
|
||||
mptestsrc_filter_deps="gpl"
|
||||
@@ -3056,9 +3036,8 @@ case "$toolchain" in
|
||||
add_ldflags -fprofile-arcs -ftest-coverage
|
||||
;;
|
||||
hardened)
|
||||
add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
|
||||
add_cflags -fno-strict-overflow -fstack-protector-all
|
||||
add_ldflags -Wl,-z,relro -Wl,-z,now
|
||||
add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all
|
||||
add_ldflags -Wl,-z,relro -Wl,-z,now
|
||||
;;
|
||||
?*)
|
||||
die "Unknown toolchain $toolchain"
|
||||
@@ -3070,13 +3049,9 @@ set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
|
||||
enabled cross_compile || host_cc_default=$cc
|
||||
set_default host_cc
|
||||
|
||||
pkg_config_fail_message=""
|
||||
if ! $pkg_config --version >/dev/null 2>&1; then
|
||||
warn "$pkg_config not found, library detection may fail."
|
||||
pkg_config=false
|
||||
elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
|
||||
pkg_config_fail_message="
|
||||
Note: When building a static binary, add --pkg-config-flags=\"--static\"."
|
||||
fi
|
||||
|
||||
if test $doxygen != $doxygen_default && \
|
||||
@@ -3453,6 +3428,29 @@ probe_cc(){
|
||||
# 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)
|
||||
_DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
|
||||
_DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
|
||||
_cflags_speed="-O2"
|
||||
_cflags_size="-O1"
|
||||
if $_cc 2>&1 | grep -q Linker; then
|
||||
_ld_o='-out:$@'
|
||||
else
|
||||
_ld_o='-Fe$@'
|
||||
fi
|
||||
_cc_o='-Fo$@'
|
||||
_cc_e='-P -Fi$@'
|
||||
_flags_filter=msvc_flags
|
||||
_ld_lib='lib%.a'
|
||||
_ld_path='-libpath:'
|
||||
_flags='-nologo'
|
||||
_cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
|
||||
if [ $pfx = hostcc ]; then
|
||||
append _cflags -Dsnprintf=_snprintf
|
||||
fi
|
||||
disable stripping
|
||||
elif $_cc 2>&1 | grep -q Intel; then
|
||||
_type=icl
|
||||
_ident=$($cc 2>&1 | head -n1)
|
||||
@@ -3479,30 +3477,6 @@ probe_cc(){
|
||||
if [ $pfx = hostcc ]; then
|
||||
append _cflags -Dsnprintf=_snprintf
|
||||
fi
|
||||
disable stripping
|
||||
elif $_cc 2>&1 | grep -q Microsoft; then
|
||||
_type=msvc
|
||||
_ident=$($cc 2>&1 | head -n1)
|
||||
_DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
|
||||
_DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
|
||||
_cflags_speed="-O2"
|
||||
_cflags_size="-O1"
|
||||
if $_cc 2>&1 | grep -q Linker; then
|
||||
_ld_o='-out:$@'
|
||||
else
|
||||
_ld_o='-Fe$@'
|
||||
fi
|
||||
_cc_o='-Fo$@'
|
||||
_cc_e='-P -Fi$@'
|
||||
_flags_filter=msvc_flags
|
||||
_ld_lib='lib%.a'
|
||||
_ld_path='-libpath:'
|
||||
_flags='-nologo'
|
||||
_cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
|
||||
if [ $pfx = hostcc ]; then
|
||||
append _cflags -Dsnprintf=_snprintf
|
||||
fi
|
||||
disable stripping
|
||||
elif $_cc --version 2>/dev/null | grep -q ^cparser; then
|
||||
_type=cparser
|
||||
_ident=$($_cc --version | head -n1)
|
||||
@@ -3960,9 +3934,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
|
||||
@@ -4062,7 +4033,6 @@ case $target_os in
|
||||
enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
|
||||
check_ldflags -Wl,--nxcompat
|
||||
check_ldflags -Wl,--dynamicbase
|
||||
enabled x86_32 && check_ldflags -Wl,--large-address-aware
|
||||
shlibdir_default="$bindir_default"
|
||||
SLIBPREF=""
|
||||
SLIBSUF=".dll"
|
||||
@@ -4095,7 +4065,6 @@ case $target_os in
|
||||
# Cannot build both shared and static libs with MSVC or icl.
|
||||
disable static
|
||||
fi
|
||||
enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
|
||||
shlibdir_default="$bindir_default"
|
||||
SLIBPREF=""
|
||||
SLIBSUF=".dll"
|
||||
@@ -4261,15 +4230,6 @@ probe_libc(){
|
||||
eval ${pfx}libc_type=solaris
|
||||
add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
|
||||
fi
|
||||
check_${pfx}cc <<EOF
|
||||
#include <time.h>
|
||||
void *v = localtime_r;
|
||||
EOF
|
||||
test "$?" != 0 && check_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 <<EOF && add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
|
||||
#include <time.h>
|
||||
void *v = localtime_r;
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
probe_libc
|
||||
@@ -4413,8 +4373,8 @@ unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
|
||||
EOF
|
||||
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
|
||||
|
||||
if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] || enabled ppc64; then
|
||||
if ! enabled bigendian && enabled altivec ;then
|
||||
if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] ;then
|
||||
if ! enabled bigendian ;then
|
||||
enable vsx
|
||||
fi
|
||||
fi
|
||||
@@ -4520,11 +4480,6 @@ EOF
|
||||
check_as <<EOF && enable as_dn_directive
|
||||
ra .dn d0.i16
|
||||
.unreq ra
|
||||
EOF
|
||||
|
||||
# llvm's integrated assembler supports .object_arch from llvm 3.5
|
||||
[ "$objformat" = elf ] && check_as <<EOF && enable as_object_arch
|
||||
.object_arch armv4
|
||||
EOF
|
||||
|
||||
[ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
|
||||
@@ -4545,7 +4500,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
|
||||
|
||||
@@ -4653,7 +4608,6 @@ 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=
|
||||
@@ -4661,10 +4615,6 @@ elif check_func dlopen -ldl; then
|
||||
ldl=-ldl
|
||||
fi
|
||||
|
||||
frei0r_filter_extralibs='$ldl'
|
||||
frei0r_src_filter_extralibs='$ldl'
|
||||
ladspa_filter_extralibs='$ldl'
|
||||
|
||||
if ! disabled network; then
|
||||
check_func getaddrinfo $network_extralibs
|
||||
check_func getservbyport $network_extralibs
|
||||
@@ -4706,7 +4656,6 @@ if ! disabled network; then
|
||||
fi
|
||||
|
||||
check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
|
||||
check_builtin atomic_compare_exchange "" "int *ptr, *oldval; int newval; __atomic_compare_exchange_n(ptr, oldval, newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)"
|
||||
check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
|
||||
check_builtin MemoryBarrier windows.h "MemoryBarrier()"
|
||||
check_builtin sarestart signal.h "SA_RESTART"
|
||||
@@ -4717,14 +4666,13 @@ 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 && LIBRT="-lrt"; }
|
||||
check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt; }
|
||||
check_func fcntl
|
||||
check_func fork
|
||||
check_func gethrtime
|
||||
check_func getopt
|
||||
check_func getrusage
|
||||
check_func gettimeofday
|
||||
check_func gmtime_r
|
||||
check_func isatty
|
||||
check_func localtime_r
|
||||
check_func mach_absolute_time
|
||||
@@ -4732,7 +4680,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 && LIBRT="-lrt"; }
|
||||
check_func_headers time.h nanosleep || { check_func_headers time.h 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
|
||||
@@ -4751,16 +4699,15 @@ check_func_headers windows.h GetProcessAffinityMask
|
||||
check_func_headers windows.h GetProcessTimes
|
||||
check_func_headers windows.h GetSystemTimeAsFileTime
|
||||
check_func_headers windows.h MapViewOfFile
|
||||
check_func_headers windows.h MoveFileExA
|
||||
check_func_headers windows.h PeekNamedPipe
|
||||
check_func_headers windows.h SetConsoleTextAttribute
|
||||
check_func_headers windows.h Sleep
|
||||
check_func_headers windows.h VirtualAlloc
|
||||
check_struct windows.h "CONDITION_VARIABLE" Ptr
|
||||
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
|
||||
@@ -4769,7 +4716,6 @@ check_header io.h
|
||||
check_header libcrystalhd/libcrystalhd_if.h
|
||||
check_header mach/mach_time.h
|
||||
check_header malloc.h
|
||||
check_header net/udplite.h
|
||||
check_header poll.h
|
||||
check_header sys/mman.h
|
||||
check_header sys/param.h
|
||||
@@ -4835,6 +4781,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}
|
||||
@@ -4877,8 +4824,7 @@ 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
|
||||
enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
|
||||
enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
|
||||
enabled libopenjpeg && { check_lib openjpeg.h opj_version -lopenmj2 -DOPJ_STATIC ||
|
||||
check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
|
||||
enabled libopenjpeg && { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
|
||||
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
|
||||
@@ -4887,8 +4833,9 @@ 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
|
||||
enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
|
||||
enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
|
||||
require smbclient libsmbclient.h smbc_init -lsmbclient; }
|
||||
enabled libsmbclient && { { check_pkg_config smbclient libsmbclient.h smbc_init &&
|
||||
require_pkg_config smbclient libsmbclient.h smbc_init; } ||
|
||||
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
|
||||
@@ -4913,10 +4860,10 @@ enabled libvpx && {
|
||||
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 libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
|
||||
enabled libwebp && require_pkg_config "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
|
||||
enabled libx264 && { use_pkg_config x264 "stdint.h x264.h" x264_encoder_encode ||
|
||||
{ require libx264 x264.h x264_encoder_encode -lx264 &&
|
||||
warn "using libx264 without pkg-config"; } } &&
|
||||
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 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."; }
|
||||
enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
|
||||
@@ -4962,26 +4909,21 @@ if enabled libdc1394; then
|
||||
enable libdc1394_1; } ||
|
||||
die "ERROR: No version of libdc1394 found "
|
||||
fi
|
||||
if ! disabled sdl; then
|
||||
SDL_CONFIG="${cross_prefix}sdl-config"
|
||||
if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
|
||||
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
|
||||
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
|
||||
enable sdl
|
||||
else
|
||||
if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
|
||||
sdl_cflags=$("${SDL_CONFIG}" --cflags)
|
||||
sdl_libs=$("${SDL_CONFIG}" --libs)
|
||||
check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
|
||||
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
|
||||
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
|
||||
enable sdl
|
||||
elif enabled sdl ; then
|
||||
die "ERROR: SDL not found"
|
||||
else
|
||||
disable sdl
|
||||
fi
|
||||
fi
|
||||
|
||||
SDL_CONFIG="${cross_prefix}sdl-config"
|
||||
if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
|
||||
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
|
||||
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
|
||||
enable sdl
|
||||
else
|
||||
if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
|
||||
sdl_cflags=$("${SDL_CONFIG}" --cflags)
|
||||
sdl_libs=$("${SDL_CONFIG}" --libs)
|
||||
check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
|
||||
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
|
||||
check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
|
||||
enable sdl
|
||||
fi
|
||||
fi
|
||||
enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
|
||||
|
||||
@@ -5000,7 +4942,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
|
||||
@@ -5046,37 +4987,10 @@ fi
|
||||
enabled xlib &&
|
||||
check_lib X11/Xlib.h XOpenDisplay -lX11 || disable xlib
|
||||
|
||||
if ! disabled libxcb; then
|
||||
check_pkg_config xcb xcb/xcb.h xcb_connect || {
|
||||
enabled libxcb && die "ERROR: libxcb not found";
|
||||
} && disable x11grab && enable libxcb
|
||||
|
||||
if enabled libxcb; then
|
||||
disabled libxcb_shm || {
|
||||
check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
|
||||
enabled libxcb_shm && die "ERROR: libxcb_shm not found";
|
||||
} && check_header sys/shm.h && enable libxcb_shm; }
|
||||
|
||||
disabled libxcb_xfixes || {
|
||||
check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image || {
|
||||
enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
|
||||
} && enable libxcb_xfixes; }
|
||||
|
||||
disabled libxcb_shape || {
|
||||
check_pkg_config xcb-shape xcb/shape.h xcb_shape_get_rectangles || {
|
||||
enabled libxcb_shape && die "ERROR: libxcb_shape not found";
|
||||
} && enable libxcb_shape; }
|
||||
|
||||
add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags
|
||||
add_extralibs $xcb_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_libs
|
||||
fi
|
||||
fi
|
||||
|
||||
if enabled x11grab; then
|
||||
enabled xlib || die "ERROR: Xlib not found"
|
||||
require Xext X11/extensions/XShm.h XShmCreateImage -lXext
|
||||
require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
|
||||
fi
|
||||
enabled x11grab &&
|
||||
require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
|
||||
require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes &&
|
||||
{ enabled xlib || die "ERROR: Xlib not found"; }
|
||||
|
||||
check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
|
||||
|
||||
@@ -5387,6 +5301,7 @@ 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"
|
||||
@@ -5682,7 +5597,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})"
|
||||
@@ -5710,7 +5625,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
|
||||
@@ -5797,7 +5711,7 @@ Cflags: -I\${includedir}
|
||||
EOF
|
||||
}
|
||||
|
||||
pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBRT $LIBM"
|
||||
pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
|
||||
pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
|
||||
pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
|
||||
pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
|
||||
|
@@ -15,58 +15,6 @@ libavutil: 2014-08-09
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
2014-11-21 - ab922f9 - lavu 54.15.100 - dict.h
|
||||
Add av_dict_get_string().
|
||||
|
||||
2014-11-18 - a54a51c - lavu 54.14.100 - float_dsp.h
|
||||
Add avpriv_float_dsp_alloc().
|
||||
|
||||
2014-11-16 - 6690d4c3 - lavf 56.13.100 - avformat.h
|
||||
Add AVStream.recommended_encoder_configuration with accessors.
|
||||
|
||||
2014-11-16 - bee5844d - lavu 54.13.100 - opt.h
|
||||
Add av_opt_serialize().
|
||||
|
||||
2014-11-16 - eec69332 - lavu 54.12.100 - opt.h
|
||||
Add av_opt_is_set_to_default().
|
||||
|
||||
2014-11-06 - 44fa267 / 5e80fb7 - lavc 56.11.100 / 56.6.0 - vorbis_parser.h
|
||||
Add a public API for parsing vorbis packets.
|
||||
|
||||
2014-10-15 - 17085a0 / 7ea1b34 - lavc 56.7.100 / 56.5.0 - avcodec.h
|
||||
Replace AVCodecContext.time_base used for decoding
|
||||
with AVCodecContext.framerate.
|
||||
|
||||
2014-10-15 - 51c810e / d565fef1 - lavc 56.6.100 / 56.4.0 - avcodec.h
|
||||
Add AV_HWACCEL_FLAG_IGNORE_LEVEL flag to av_vdpau_bind_context().
|
||||
|
||||
2014-10-13 - da21895 / 2df0c32e - lavc 56.5.100 / 56.3.0 - avcodec.h
|
||||
Add AVCodecContext.initial_padding. Deprecate the use of AVCodecContext.delay
|
||||
for audio encoding.
|
||||
|
||||
2014-10-08 - bb44f7d / 5a419b2 - lavu 54.10.100 / 54.4.0 - pixdesc.h
|
||||
Add API to return the name of frame and context color properties.
|
||||
|
||||
2014-10-06 - a61899a / e3e158e - lavc 56.3.100 / 56.2.0 - vdpau.h
|
||||
Add av_vdpau_bind_context(). This function should now be used for creating
|
||||
(or resetting) a AVVDPAUContext instead of av_vdpau_alloc_context().
|
||||
|
||||
2014-10-02 - cdd6f05 - lavc 56.2.100 - avcodec.h
|
||||
2014-10-02 - cdd6f05 - lavu 54.9.100 - frame.h
|
||||
Add AV_FRAME_DATA_SKIP_SAMPLES. Add lavc CODEC_FLAG2_SKIP_MANUAL and
|
||||
AVOption "skip_manual", which makes lavc export skip information via
|
||||
AV_FRAME_DATA_SKIP_SAMPLES AVFrame side data, instead of skipping and
|
||||
discarding samples automatically.
|
||||
|
||||
2014-10-02 - 0d92b0d - lavu 54.8.100 - avstring.h
|
||||
Add av_match_list()
|
||||
|
||||
2014-09-24 - ac68295 - libpostproc 53.1.100
|
||||
Add visualization support
|
||||
|
||||
2014-09-19 - 6edd6a4 - lavc 56.1.101 - dv_profile.h
|
||||
deprecate avpriv_dv_frame_profile2(), which was made public by accident.
|
||||
|
||||
|
||||
-------- 8< --------- FFmpeg 2.4 was cut here -------- 8< ---------
|
||||
|
||||
@@ -200,7 +148,7 @@ API changes, most recent first:
|
||||
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.
|
||||
|
||||
@@ -224,7 +172,7 @@ API changes, most recent first:
|
||||
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
|
||||
@@ -234,7 +182,7 @@ API changes, most recent first:
|
||||
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
|
||||
@@ -266,10 +214,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
|
||||
@@ -288,14 +236,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
|
||||
@@ -307,7 +251,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
|
||||
@@ -387,7 +331,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
|
||||
@@ -428,7 +372,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
|
||||
@@ -918,9 +862,6 @@ lavd 54.4.100 / 54.0.0, lavfi 3.5.0
|
||||
avresample_read() are now uint8_t** instead of void**.
|
||||
Libavresample is now stable.
|
||||
|
||||
2012-09-26 - 3ba0dab7 / 1384df64 - lavf 54.29.101 / 56.06.3 - avformat.h
|
||||
Add AVFormatContext.avoid_negative_ts.
|
||||
|
||||
2012-09-24 - 46a3595 / a42aada - lavc 54.59.100 / 54.28.0 - avcodec.h
|
||||
Add avcodec_free_frame(). This function must now
|
||||
be used for freeing an AVFrame.
|
||||
|
@@ -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.5.11
|
||||
PROJECT_NUMBER = 2.4.1
|
||||
|
||||
# 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
|
||||
|
@@ -13,16 +13,7 @@ bitstream filter using the option @code{--disable-bsf=BSF}.
|
||||
The option @code{-bsfs} of the ff* tools will display the list of
|
||||
all the supported bitstream filters included in your build.
|
||||
|
||||
The ff* tools have a -bsf option applied per stream, taking a
|
||||
comma-separated list of filters, whose parameters follow the filter
|
||||
name after a '='.
|
||||
|
||||
@example
|
||||
ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1/opt2=str2][,filter2] OUTPUT
|
||||
@end example
|
||||
|
||||
Below is a description of the currently available bitstream filters,
|
||||
with their parameters, if any.
|
||||
Below is a description of the currently available bitstream filters.
|
||||
|
||||
@section aac_adtstoasc
|
||||
|
||||
@@ -144,16 +135,9 @@ ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
|
||||
Damages the contents of packets without damaging the container. Can be
|
||||
used for fuzzing or testing error resilience/concealment.
|
||||
|
||||
Parameters:
|
||||
A numeral string, whose value is related to how often output bytes will
|
||||
be modified. Therefore, values below or equal to 0 are forbidden, and
|
||||
the lower the more frequent bytes will be modified, with 1 meaning
|
||||
every byte is modified.
|
||||
|
||||
@example
|
||||
ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
|
||||
ffmpeg -i INPUT -c copy -bsf noise output.mkv
|
||||
@end example
|
||||
applies the modification to every byte.
|
||||
|
||||
@section remove_extra
|
||||
|
||||
|
@@ -71,9 +71,7 @@ Force low delay.
|
||||
@item global_header
|
||||
Place global headers in extradata instead of every keyframe.
|
||||
@item bitexact
|
||||
Only write platform-, build- and time-independent data. (except (I)DCT).
|
||||
This ensures that file and data checksums are reproducible and match between
|
||||
platforms. Its primary use is for regression testing.
|
||||
Use only bitexact stuff (except (I)DCT).
|
||||
@item aic
|
||||
Apply H263 advanced intra coding / mpeg4 ac prediction.
|
||||
@item cbp
|
||||
@@ -1116,19 +1114,6 @@ Interlaced video, bottom coded first, top displayed first
|
||||
Set to 1 to disable processing alpha (transparency). This works like the
|
||||
@samp{gray} flag in the @option{flags} option which skips chroma information
|
||||
instead of alpha. Default is 0.
|
||||
|
||||
@item codec_whitelist @var{list} (@emph{input})
|
||||
"," separated List of allowed decoders. By default all are allowed.
|
||||
|
||||
@item dump_separator @var{string} (@emph{input})
|
||||
Separator used to separate the fields printed on the command line about the
|
||||
Stream parameters.
|
||||
For example to separate the fields with newlines and indention:
|
||||
@example
|
||||
ffprobe -dump_separator "
|
||||
" -i ~/videos/matrixbench_mpeg2.mpg
|
||||
@end example
|
||||
|
||||
@end table
|
||||
|
||||
@c man end CODEC OPTIONS
|
||||
|
@@ -190,15 +190,6 @@ The format for this option is a string containing 16 24-bits hexadecimal
|
||||
numbers (without 0x prefix) separated by comas, for example @code{0d00ee,
|
||||
ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
|
||||
7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}.
|
||||
|
||||
@item ifo_palette
|
||||
Specify the IFO file from which the global palette is obtained.
|
||||
(experimental)
|
||||
|
||||
@item forced_subs_only
|
||||
Only decode subtitle entries marked as forced. Some titles have forced
|
||||
and non-forced subtitles in the same track. Setting this flag to @code{1}
|
||||
will only keep the forced subtitles. Default value is @code{0}.
|
||||
@end table
|
||||
|
||||
@section libzvbi-teletext
|
||||
|
@@ -29,26 +29,6 @@ the caller can decide which variant streams to actually receive.
|
||||
The total bitrate of the variant that the stream belongs to is
|
||||
available in a metadata key named "variant_bitrate".
|
||||
|
||||
@section apng
|
||||
|
||||
Animated Portable Network Graphics demuxer.
|
||||
|
||||
This demuxer is used to demux APNG files.
|
||||
All headers, but the PNG signature, up to (but not including) the first
|
||||
fcTL chunk are transmitted as extradata.
|
||||
Frames are then split as being all the chunks between two fcTL ones, or
|
||||
between the last fcTL and IEND chunks.
|
||||
|
||||
@table @option
|
||||
@item -ignore_loop @var{bool}
|
||||
Ignore the loop variable in the file if set.
|
||||
@item -max_fps @var{int}
|
||||
Maximum framerate in frames per second (0 for no limit).
|
||||
@item -default_fps @var{int}
|
||||
Default framerate in frames per second when none is specified in the file
|
||||
(0 meaning as fast as possible).
|
||||
@end table
|
||||
|
||||
@section asf
|
||||
|
||||
Advanced Systems Format demuxer.
|
||||
@@ -98,7 +78,7 @@ All subsequent file-related directives apply to that file.
|
||||
|
||||
@item @code{ffconcat version 1.0}
|
||||
Identify the script type and version. It also sets the @option{safe} option
|
||||
to 1 if it was -1.
|
||||
to 1 if it was to its default -1.
|
||||
|
||||
To make FFmpeg recognize the format automatically, this directive must
|
||||
appears exactly as is (no extra space or byte-order-mark) on the very first
|
||||
@@ -145,9 +125,7 @@ component.
|
||||
|
||||
If set to 0, any file name is accepted.
|
||||
|
||||
The default is 1.
|
||||
|
||||
-1 is equivalent to 1 if the format was automatically
|
||||
The default is -1, it is equivalent to 1 if the format was automatically
|
||||
probed and 0 otherwise.
|
||||
|
||||
@item auto_convert
|
||||
@@ -361,23 +339,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.
|
||||
|
@@ -1745,10 +1745,6 @@ Enable calculation and printing SSIM stats after the encoding.
|
||||
Enable the use of Periodic Intra Refresh instead of IDR frames when set
|
||||
to 1.
|
||||
|
||||
@item avcintra-class (@emph{class})
|
||||
Configure the encoder to generate AVC-Intra.
|
||||
Valid values are 50,100 and 200
|
||||
|
||||
@item bluray-compat (@emph{bluray-compat})
|
||||
Configure the encoder to be compatible with the bluray standard.
|
||||
It is a shorthand for setting "bluray-compat=1 force-cfr=1".
|
||||
@@ -1886,34 +1882,6 @@ no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
|
||||
Encoding ffpresets for common usages are provided so they can be used with the
|
||||
general presets system (e.g. passing the @option{pre} option).
|
||||
|
||||
@section libx265
|
||||
|
||||
x265 H.265/HEVC encoder wrapper.
|
||||
|
||||
This encoder requires the presence of the libx265 headers and library
|
||||
during configuration. You need to explicitly configure the build with
|
||||
@option{--enable-libx265}.
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
@item preset
|
||||
Set the x265 preset.
|
||||
|
||||
@item tune
|
||||
Set the x265 tune parameter.
|
||||
|
||||
@item x265-params
|
||||
Set x265 options using a list of @var{key}=@var{value} couples separated
|
||||
by ":". See @command{x265 --help} for a list of options.
|
||||
|
||||
For example to specify libx265 encoding options with @option{-x265-params}:
|
||||
|
||||
@example
|
||||
ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
|
||||
@end example
|
||||
@end table
|
||||
|
||||
@section libxvid
|
||||
|
||||
Xvid MPEG-4 Part 2 encoder wrapper.
|
||||
|
@@ -29,7 +29,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
|
||||
|
||||
|
@@ -288,7 +288,6 @@ static void audio_decode_example(const char *outfilename, const char *filename)
|
||||
avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);
|
||||
|
||||
while (avpkt.size > 0) {
|
||||
int i, ch;
|
||||
int got_frame = 0;
|
||||
|
||||
if (!decoded_frame) {
|
||||
@@ -305,15 +304,15 @@ static void audio_decode_example(const char *outfilename, const char *filename)
|
||||
}
|
||||
if (got_frame) {
|
||||
/* if a frame has been decoded, output it */
|
||||
int data_size = av_get_bytes_per_sample(c->sample_fmt);
|
||||
int data_size = av_samples_get_buffer_size(NULL, c->channels,
|
||||
decoded_frame->nb_samples,
|
||||
c->sample_fmt, 1);
|
||||
if (data_size < 0) {
|
||||
/* This should not occur, checking just for paranoia */
|
||||
fprintf(stderr, "Failed to calculate data size\n");
|
||||
exit(1);
|
||||
}
|
||||
for (i=0; i<decoded_frame->nb_samples; i++)
|
||||
for (ch=0; ch<c->channels; ch++)
|
||||
fwrite(decoded_frame->data[ch] + data_size*i, 1, data_size, outfile);
|
||||
fwrite(decoded_frame->data[0], 1, data_size, outfile);
|
||||
}
|
||||
avpkt.size -= len;
|
||||
avpkt.data += len;
|
||||
@@ -651,7 +650,7 @@ int main(int argc, char **argv)
|
||||
video_encode_example("test.h264", AV_CODEC_ID_H264);
|
||||
} else if (!strcmp(output_type, "mp2")) {
|
||||
audio_encode_example("test.mp2");
|
||||
audio_decode_example("test.pcm", "test.mp2");
|
||||
audio_decode_example("test.sw", "test.mp2");
|
||||
} else if (!strcmp(output_type, "mpg")) {
|
||||
video_encode_example("test.mpg", AV_CODEC_ID_MPEG1VIDEO);
|
||||
video_decode_example("test%02d.pgm", "test.mpg");
|
||||
|
@@ -90,7 +90,6 @@ static int init_filters(const char *filters_descr)
|
||||
AVFilter *buffersink = avfilter_get_by_name("buffersink");
|
||||
AVFilterInOut *outputs = avfilter_inout_alloc();
|
||||
AVFilterInOut *inputs = avfilter_inout_alloc();
|
||||
AVRational time_base = fmt_ctx->streams[video_stream_index]->time_base;
|
||||
enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
|
||||
|
||||
filter_graph = avfilter_graph_alloc();
|
||||
@@ -103,7 +102,7 @@ static int init_filters(const char *filters_descr)
|
||||
snprintf(args, sizeof(args),
|
||||
"video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
|
||||
dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,
|
||||
time_base.num, time_base.den,
|
||||
dec_ctx->time_base.num, dec_ctx->time_base.den,
|
||||
dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den);
|
||||
|
||||
ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in",
|
||||
|
@@ -306,7 +306,7 @@ static int decode_audio_frame(AVFrame *frame,
|
||||
|
||||
/** Read one audio frame from the input file into a temporary packet. */
|
||||
if ((error = av_read_frame(input_format_context, &input_packet)) < 0) {
|
||||
/** If we are at the end of the file, flush the decoder below. */
|
||||
/** If we are the the end of the file, flush the decoder below. */
|
||||
if (error == AVERROR_EOF)
|
||||
*finished = 1;
|
||||
else {
|
||||
|
@@ -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
|
||||
@@ -389,9 +385,17 @@ static int encode_write_frame(AVFrame *filt_frame, unsigned int stream_index, in
|
||||
|
||||
/* prepare packet for muxing */
|
||||
enc_pkt.stream_index = stream_index;
|
||||
av_packet_rescale_ts(&enc_pkt,
|
||||
ofmt_ctx->streams[stream_index]->codec->time_base,
|
||||
ofmt_ctx->streams[stream_index]->time_base);
|
||||
enc_pkt.dts = av_rescale_q_rnd(enc_pkt.dts,
|
||||
ofmt_ctx->streams[stream_index]->codec->time_base,
|
||||
ofmt_ctx->streams[stream_index]->time_base,
|
||||
AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
|
||||
enc_pkt.pts = av_rescale_q_rnd(enc_pkt.pts,
|
||||
ofmt_ctx->streams[stream_index]->codec->time_base,
|
||||
ofmt_ctx->streams[stream_index]->time_base,
|
||||
AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
|
||||
enc_pkt.duration = av_rescale_q(enc_pkt.duration,
|
||||
ofmt_ctx->streams[stream_index]->codec->time_base,
|
||||
ofmt_ctx->streams[stream_index]->time_base);
|
||||
|
||||
av_log(NULL, AV_LOG_DEBUG, "Muxing frame\n");
|
||||
/* mux encoded frame */
|
||||
@@ -505,9 +509,14 @@ int main(int argc, char **argv)
|
||||
ret = AVERROR(ENOMEM);
|
||||
break;
|
||||
}
|
||||
av_packet_rescale_ts(&packet,
|
||||
ifmt_ctx->streams[stream_index]->time_base,
|
||||
ifmt_ctx->streams[stream_index]->codec->time_base);
|
||||
packet.dts = av_rescale_q_rnd(packet.dts,
|
||||
ifmt_ctx->streams[stream_index]->time_base,
|
||||
ifmt_ctx->streams[stream_index]->codec->time_base,
|
||||
AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
|
||||
packet.pts = av_rescale_q_rnd(packet.pts,
|
||||
ifmt_ctx->streams[stream_index]->time_base,
|
||||
ifmt_ctx->streams[stream_index]->codec->time_base,
|
||||
AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
|
||||
dec_func = (type == AVMEDIA_TYPE_VIDEO) ? avcodec_decode_video2 :
|
||||
avcodec_decode_audio4;
|
||||
ret = dec_func(ifmt_ctx->streams[stream_index]->codec, frame,
|
||||
@@ -529,9 +538,14 @@ int main(int argc, char **argv)
|
||||
}
|
||||
} else {
|
||||
/* remux this frame without reencoding */
|
||||
av_packet_rescale_ts(&packet,
|
||||
ifmt_ctx->streams[stream_index]->time_base,
|
||||
ofmt_ctx->streams[stream_index]->time_base);
|
||||
packet.dts = av_rescale_q_rnd(packet.dts,
|
||||
ifmt_ctx->streams[stream_index]->time_base,
|
||||
ofmt_ctx->streams[stream_index]->time_base,
|
||||
AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
|
||||
packet.pts = av_rescale_q_rnd(packet.pts,
|
||||
ifmt_ctx->streams[stream_index]->time_base,
|
||||
ofmt_ctx->streams[stream_index]->time_base,
|
||||
AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
|
||||
|
||||
ret = av_interleaved_write_frame(ofmt_ctx, &packet);
|
||||
if (ret < 0)
|
||||
|
@@ -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
|
||||
|
@@ -360,7 +360,7 @@ ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
|
||||
@end example
|
||||
|
||||
@item -dframes @var{number} (@emph{output})
|
||||
Set the number of data frames to output. This is an alias for @code{-frames:d}.
|
||||
Set the number of data frames to record. This is an alias for @code{-frames:d}.
|
||||
|
||||
@item -frames[:@var{stream_specifier}] @var{framecount} (@emph{output,per-stream})
|
||||
Stop writing to the stream after @var{framecount} frames.
|
||||
@@ -467,7 +467,7 @@ attachments.
|
||||
|
||||
@table @option
|
||||
@item -vframes @var{number} (@emph{output})
|
||||
Set the number of video frames to output. This is an alias for @code{-frames:v}.
|
||||
Set the number of video frames to record. This is an alias for @code{-frames:v}.
|
||||
@item -r[:@var{stream_specifier}] @var{fps} (@emph{input/output,per-stream})
|
||||
Set frame rate (Hz value, fraction or abbreviation).
|
||||
|
||||
@@ -692,7 +692,7 @@ If this option is not specified, the default adapter is used.
|
||||
|
||||
@table @option
|
||||
@item -aframes @var{number} (@emph{output})
|
||||
Set the number of audio frames to output. This is an alias for @code{-frames:a}.
|
||||
Set the number of audio frames to record. This is an alias for @code{-frames:a}.
|
||||
@item -ar[:@var{stream_specifier}] @var{freq} (@emph{input/output,per-stream})
|
||||
Set the audio sampling frequency. For output streams it is set by
|
||||
default to the frequency of the corresponding input stream. For input
|
||||
@@ -1016,12 +1016,6 @@ processing (e.g. in case the format option @option{avoid_negative_ts}
|
||||
is enabled) the output timestamps may mismatch with the input
|
||||
timestamps even when this option is selected.
|
||||
|
||||
@item -start_at_zero
|
||||
When used with @option{copyts}, shift input timestamps so they start at zero.
|
||||
|
||||
This means that using e.g. @code{-ss 50} will make output timestamps start at
|
||||
50 seconds, regardless of what timestamp the input file started at.
|
||||
|
||||
@item -copytb @var{mode}
|
||||
Specify how to set the encoder timebase when stream copying. @var{mode} is an
|
||||
integer numeric value, and can assume one of the following values:
|
||||
|
@@ -37,14 +37,10 @@ Force displayed height.
|
||||
Set frame size (WxH or abbreviation), needed for videos which do
|
||||
not contain a header with the frame size like raw YUV. This option
|
||||
has been deprecated in favor of private options, try -video_size.
|
||||
@item -fs
|
||||
Start in fullscreen mode.
|
||||
@item -an
|
||||
Disable audio.
|
||||
@item -vn
|
||||
Disable video.
|
||||
@item -sn
|
||||
Disable subtitles.
|
||||
@item -ss @var{pos}
|
||||
Seek to a given position in seconds.
|
||||
@item -t @var{duration}
|
||||
@@ -113,10 +109,15 @@ duration, the codec parameters, the current position in the stream and
|
||||
the audio/video synchronisation drift. It is on by default, to
|
||||
explicitly disable it you need to specify @code{-nostats}.
|
||||
|
||||
@item -bug
|
||||
Work around bugs.
|
||||
@item -fast
|
||||
Non-spec-compliant optimizations.
|
||||
@item -genpts
|
||||
Generate pts.
|
||||
@item -rtp_tcp
|
||||
Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful
|
||||
if you are streaming with the RTSP protocol.
|
||||
@item -sync @var{type}
|
||||
Set the master clock to audio (@code{type=audio}), video
|
||||
(@code{type=video}) or external (@code{type=ext}). Default is audio. The
|
||||
@@ -125,8 +126,7 @@ players use audio as master clock, but in some cases (streaming or high
|
||||
quality broadcast) it is necessary to change that. This option is mainly
|
||||
used for debugging purposes.
|
||||
@item -threads @var{count}
|
||||
Set the thread count. By default, @command{ffplay} automatically detects a
|
||||
suitable number of threads to use.
|
||||
Set the thread count.
|
||||
@item -ast @var{audio_stream_number}
|
||||
Select the desired audio stream number, counting from 0. The number
|
||||
refers to the list of all the input audio streams. If it is greater
|
||||
@@ -164,20 +164,8 @@ Force a specific video decoder.
|
||||
Force a specific subtitle decoder.
|
||||
|
||||
@item -autorotate
|
||||
Automatically rotate the video according to presentation metadata. Enabled by
|
||||
default, use @option{-noautorotate} to disable it.
|
||||
|
||||
@item -framedrop
|
||||
Drop video frames if video is out of sync. Enabled by default if the master
|
||||
clock is not set to video. Use this option to enable frame dropping for all
|
||||
master clock sources, use @option{-noframedrop} to disable it.
|
||||
|
||||
@item -infbuf
|
||||
Do not limit the input buffer size, read as much data as possible from the
|
||||
input as soon as possible. Enabled by default for realtime streams, where data
|
||||
may be dropped if not read in time. Use this option to enable infinite buffers
|
||||
for all inputs, use @option{-noinfbuf} to disable it.
|
||||
|
||||
Automatically rotate the video according to presentation metadata. Set by
|
||||
default, use -noautorotate to disable.
|
||||
@end table
|
||||
|
||||
@section While playing
|
||||
|
@@ -321,12 +321,6 @@ Show information related to program and library versions. This is the
|
||||
equivalent of setting both @option{-show_program_version} and
|
||||
@option{-show_library_versions} options.
|
||||
|
||||
@item -show_pixel_formats
|
||||
Show information about all pixel formats supported by FFmpeg.
|
||||
|
||||
Pixel format information for each format is printed within a section
|
||||
with name "PIXEL_FORMAT".
|
||||
|
||||
@item -bitexact
|
||||
Force bitexact output, useful to produce output which is not dependent
|
||||
on the specific build.
|
||||
|
@@ -10,10 +10,8 @@
|
||||
<xsd:sequence>
|
||||
<xsd:element name="program_version" type="ffprobe:programVersionType" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element name="library_versions" type="ffprobe:libraryVersionsType" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element name="pixel_formats" type="ffprobe:pixelFormatsType" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element name="packets" type="ffprobe:packetsType" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element name="frames" type="ffprobe:framesType" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element name="packets_and_frames" type="ffprobe:packetsAndFramesType" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element name="programs" type="ffprobe:programsType" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element name="streams" type="ffprobe:streamsType" minOccurs="0" maxOccurs="1" />
|
||||
<xsd:element name="chapters" type="ffprobe:chaptersType" minOccurs="0" maxOccurs="1" />
|
||||
@@ -37,16 +35,6 @@
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="packetsAndFramesType">
|
||||
<xsd:sequence>
|
||||
<xsd:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:element name="packet" type="ffprobe:packetType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="frame" type="ffprobe:frameType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xsd:element name="subtitle" type="ffprobe:subtitleType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:choice>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="packetType">
|
||||
<xsd:attribute name="codec_type" type="xsd:string" use="required" />
|
||||
<xsd:attribute name="stream_index" type="xsd:int" use="required" />
|
||||
@@ -178,9 +166,6 @@
|
||||
<xsd:attribute name="level" type="xsd:int"/>
|
||||
<xsd:attribute name="color_range" type="xsd:string"/>
|
||||
<xsd:attribute name="color_space" type="xsd:string"/>
|
||||
<xsd:attribute name="color_transfer" type="xsd:string"/>
|
||||
<xsd:attribute name="color_primaries" type="xsd:string"/>
|
||||
<xsd:attribute name="chroma_location" type="xsd:string"/>
|
||||
<xsd:attribute name="timecode" type="xsd:string"/>
|
||||
|
||||
<!-- audio attributes -->
|
||||
@@ -292,45 +277,4 @@
|
||||
<xsd:element name="library_version" type="ffprobe:libraryVersionType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="pixelFormatFlagsType">
|
||||
<xsd:attribute name="big_endian" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="palette" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="bitstream" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="hwaccel" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="planar" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="rgb" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="pseudopal" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="alpha" type="xsd:int" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="pixelFormatComponentType">
|
||||
<xsd:attribute name="index" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="bit_depth" type="xsd:int" use="required"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="pixelFormatComponentsType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="component" type="ffprobe:pixelFormatComponentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="pixelFormatType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="flags" type="ffprobe:pixelFormatFlagsType" minOccurs="0" maxOccurs="1"/>
|
||||
<xsd:element name="components" type="ffprobe:pixelFormatComponentsType" minOccurs="0" maxOccurs="1"/>
|
||||
</xsd:sequence>
|
||||
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="nb_components" type="xsd:int" use="required"/>
|
||||
<xsd:attribute name="log2_chroma_w" type="xsd:int"/>
|
||||
<xsd:attribute name="log2_chroma_h" type="xsd:int"/>
|
||||
<xsd:attribute name="bits_per_pixel" type="xsd:int"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="pixelFormatsType">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="pixel_format" type="ffprobe:pixelFormatType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
|
@@ -71,7 +71,7 @@ the HTTP server (configured through the @option{HTTPPort} option), and
|
||||
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
|
||||
@@ -408,12 +408,6 @@ ignored, and the log is written to standard output.
|
||||
Set no-daemon mode. This option is currently ignored since now
|
||||
@command{ffserver} will always work in no-daemon mode, and is
|
||||
deprecated.
|
||||
|
||||
@item UseDefaults
|
||||
@item NoDefaults
|
||||
Control whether default codec options are used for the all streams or not.
|
||||
Each stream may overwrite this setting for its own. Default is @var{UseDefaults}.
|
||||
The lastest occurrence overrides previous if multiple definitions.
|
||||
@end table
|
||||
|
||||
@section Feed section
|
||||
@@ -577,11 +571,6 @@ deprecated in favor of @option{Metadata}.
|
||||
@item Metadata @var{key} @var{value}
|
||||
Set metadata value on the output stream.
|
||||
|
||||
@item UseDefaults
|
||||
@item NoDefaults
|
||||
Control whether default codec options are used for the stream or not.
|
||||
Default is @var{UseDefaults} unless disabled globally.
|
||||
|
||||
@item NoAudio
|
||||
@item NoVideo
|
||||
Suppress audio/video.
|
||||
@@ -600,9 +589,8 @@ Set sampling frequency for audio. When using low bitrates, you should
|
||||
lower this frequency to 22050 or 11025. The supported frequencies
|
||||
depend on the selected audio codec.
|
||||
|
||||
@item AVOptionAudio [@var{codec}:]@var{option} @var{value} (@emph{encoding,audio})
|
||||
Set generic or private option for audio stream.
|
||||
Private option must be prefixed with codec name or codec must be defined before.
|
||||
@item AVOptionAudio @var{option} @var{value} (@emph{encoding,audio})
|
||||
Set generic option for audio stream.
|
||||
|
||||
@item AVPresetAudio @var{preset} (@emph{encoding,audio})
|
||||
Set preset for audio stream.
|
||||
@@ -679,9 +667,8 @@ Set video @option{qdiff} encoding option.
|
||||
@item DarkMask @var{float} (@emph{encoding,video})
|
||||
Set @option{lumi_mask}/@option{dark_mask} encoding options.
|
||||
|
||||
@item AVOptionVideo [@var{codec}:]@var{option} @var{value} (@emph{encoding,video})
|
||||
Set generic or private option for video stream.
|
||||
Private option must be prefixed with codec name or codec must be defined before.
|
||||
@item AVOptionVideo @var{option} @var{value} (@emph{encoding,video})
|
||||
Set generic option for video stream.
|
||||
|
||||
@item AVPresetVideo @var{preset} (@emph{encoding,video})
|
||||
Set preset for video stream.
|
||||
|
@@ -103,10 +103,7 @@ Print detailed information about the filter name @var{filter_name}. Use the
|
||||
Show version.
|
||||
|
||||
@item -formats
|
||||
Show available formats (including devices).
|
||||
|
||||
@item -devices
|
||||
Show available devices.
|
||||
Show available formats.
|
||||
|
||||
@item -codecs
|
||||
Show all codecs known to libavcodec.
|
||||
@@ -141,22 +138,6 @@ Show channel names and standard channel layouts.
|
||||
@item -colors
|
||||
Show recognized color names.
|
||||
|
||||
@item -sources @var{device}[,@var{opt1}=@var{val1}[,@var{opt2}=@var{val2}]...]
|
||||
Show autodetected sources of the intput device.
|
||||
Some devices may provide system-dependent source names that cannot be autodetected.
|
||||
The returned list cannot be assumed to be always complete.
|
||||
@example
|
||||
ffmpeg -sources pulse,server=192.168.0.4
|
||||
@end example
|
||||
|
||||
@item -sinks @var{device}[,@var{opt1}=@var{val1}[,@var{opt2}=@var{val2}]...]
|
||||
Show autodetected sinks of the output device.
|
||||
Some devices may provide system-dependent sink names that cannot be autodetected.
|
||||
The returned list cannot be assumed to be always complete.
|
||||
@example
|
||||
ffmpeg -sinks pulse,server=192.168.0.4
|
||||
@end example
|
||||
|
||||
@item -loglevel [repeat+]@var{loglevel} | -v [repeat+]@var{loglevel}
|
||||
Set the logging level used by the library.
|
||||
Adding "repeat+" indicates that repeated log output should not be compressed
|
||||
@@ -253,14 +234,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
|
||||
@@ -271,13 +248,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
|
||||
|
218
doc/filters.texi
218
doc/filters.texi
@@ -282,10 +282,6 @@ sequential number of the input frame, starting from 0
|
||||
|
||||
@item pos
|
||||
the position in the file of the input frame, NAN if unknown
|
||||
|
||||
@item w
|
||||
@item h
|
||||
width and height of the input frame if video
|
||||
@end table
|
||||
|
||||
Additionally, these filters support an @option{enable} command that can be used
|
||||
@@ -313,6 +309,41 @@ build.
|
||||
|
||||
Below is a description of the currently available audio filters.
|
||||
|
||||
@section aconvert
|
||||
|
||||
Convert the input audio format to the specified formats.
|
||||
|
||||
@emph{This filter is deprecated. Use @ref{aformat} instead.}
|
||||
|
||||
The filter accepts a string of the form:
|
||||
"@var{sample_format}:@var{channel_layout}".
|
||||
|
||||
@var{sample_format} specifies the sample format, and can be a string or the
|
||||
corresponding numeric value defined in @file{libavutil/samplefmt.h}. Use 'p'
|
||||
suffix for a planar sample format.
|
||||
|
||||
@var{channel_layout} specifies the channel layout, and can be a string
|
||||
or the corresponding number value defined in @file{libavutil/channel_layout.h}.
|
||||
|
||||
The special parameter "auto", signifies that the filter will
|
||||
automatically select the output format depending on the output filter.
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Convert input to float, planar, stereo:
|
||||
@example
|
||||
aconvert=fltp:stereo
|
||||
@end example
|
||||
|
||||
@item
|
||||
Convert input to unsigned 8-bit, automatically select out channel layout:
|
||||
@example
|
||||
aconvert=u8:auto
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section adelay
|
||||
|
||||
Delay one or more audio channels.
|
||||
@@ -1710,11 +1741,11 @@ The default is 0.707q and gives a Butterworth response.
|
||||
Mix channels with specific gain levels. The filter accepts the output
|
||||
channel layout followed by a set of channels definitions.
|
||||
|
||||
This filter is also designed to efficiently remap the channels of an audio
|
||||
This filter is also designed to remap efficiently the channels of an audio
|
||||
stream.
|
||||
|
||||
The filter accepts parameters of the form:
|
||||
"@var{l}|@var{outdef}|@var{outdef}|..."
|
||||
"@var{l}:@var{outdef}:@var{outdef}:..."
|
||||
|
||||
@table @option
|
||||
@item l
|
||||
@@ -1745,13 +1776,13 @@ avoiding clipping noise.
|
||||
For example, if you want to down-mix from stereo to mono, but with a bigger
|
||||
factor for the left channel:
|
||||
@example
|
||||
pan=1c|c0=0.9*c0+0.1*c1
|
||||
pan=1:c0=0.9*c0+0.1*c1
|
||||
@end example
|
||||
|
||||
A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
|
||||
7-channels surround:
|
||||
@example
|
||||
pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
|
||||
pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
|
||||
@end example
|
||||
|
||||
Note that @command{ffmpeg} integrates a default down-mix (and up-mix) system
|
||||
@@ -1774,25 +1805,25 @@ remapping.
|
||||
For example, if you have a 5.1 source and want a stereo audio stream by
|
||||
dropping the extra channels:
|
||||
@example
|
||||
pan="stereo| c0=FL | c1=FR"
|
||||
pan="stereo: c0=FL : c1=FR"
|
||||
@end example
|
||||
|
||||
Given the same source, you can also switch front left and front right channels
|
||||
and keep the input channel layout:
|
||||
@example
|
||||
pan="5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5"
|
||||
pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
|
||||
@end example
|
||||
|
||||
If the input is a stereo audio stream, you can mute the front left channel (and
|
||||
still keep the stereo channel layout) with:
|
||||
@example
|
||||
pan="stereo|c1=c1"
|
||||
pan="stereo:c1=c1"
|
||||
@end example
|
||||
|
||||
Still with a stereo audio stream input, you can copy the right channel in both
|
||||
front left and right:
|
||||
@example
|
||||
pan="stereo| c0=FR | c1=FR"
|
||||
pan="stereo: c0=FR : c1=FR"
|
||||
@end example
|
||||
|
||||
@section replaygain
|
||||
@@ -2521,26 +2552,6 @@ Same as the @ref{subtitles} filter, except that it doesn't require libavcodec
|
||||
and libavformat to work. On the other hand, it is limited to ASS (Advanced
|
||||
Substation Alpha) subtitles files.
|
||||
|
||||
This filter accepts the following option in addition to the common options from
|
||||
the @ref{subtitles} filter:
|
||||
|
||||
@table @option
|
||||
@item shaping
|
||||
Set the shaping engine
|
||||
|
||||
Available values are:
|
||||
@table @samp
|
||||
@item auto
|
||||
The default libass shaping engine, which is the best available.
|
||||
@item simple
|
||||
Fast, font-agnostic shaper that can do only substitutions
|
||||
@item complex
|
||||
Slower shaper using OpenType for substitutions and positioning
|
||||
@end table
|
||||
|
||||
The default is @code{auto}.
|
||||
@end table
|
||||
|
||||
@section bbox
|
||||
|
||||
Compute the bounding box for the non-black pixels in the input frame
|
||||
@@ -3378,7 +3389,7 @@ 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.
|
||||
|
||||
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.
|
||||
@@ -4135,7 +4146,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
|
||||
@@ -4174,7 +4185,7 @@ drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
|
||||
@item
|
||||
Print the date of a real-time encoding (see strftime(3)):
|
||||
@example
|
||||
drawtext='fontfile=FreeSans.ttf:text=%@{localtime\:%a %b %d %Y@}'
|
||||
drawtext='fontfile=FreeSans.ttf:text=%@{localtime:%a %b %d %Y@}'
|
||||
@end example
|
||||
|
||||
@item
|
||||
@@ -4447,10 +4458,6 @@ and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
|
||||
which @code{fieldmatch} is based on. While the semantic and usage are very
|
||||
close, some behaviour and options names can differ.
|
||||
|
||||
The @ref{decimate} filter currently only works for constant frame rate input.
|
||||
Do not use @code{fieldmatch} and @ref{decimate} if your input has mixed
|
||||
telecined and progressive content with changing framerate.
|
||||
|
||||
The filter accepts the following options:
|
||||
|
||||
@table @option
|
||||
@@ -5117,22 +5124,6 @@ Modify RGB components depending on pixel position:
|
||||
@example
|
||||
geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
|
||||
@end example
|
||||
|
||||
@item
|
||||
Create a radial gradient that is the same size as the input (also see
|
||||
the @ref{vignette} filter):
|
||||
@example
|
||||
geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
|
||||
@end example
|
||||
|
||||
@item
|
||||
Create a linear gradient to use as a mask for another filter, then
|
||||
compose with @ref{overlay}. In this example the video will gradually
|
||||
become more blurry from the top to the bottom of the y-axis as defined
|
||||
by the linear gradient:
|
||||
@example
|
||||
ffmpeg -i input.mp4 -filter_complex "geq=lum=255*(Y/H),format=gray[grad];[0:v]boxblur=4[blur];[blur][grad]alphamerge[alpha];[0:v][alpha]overlay" output.mp4
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@section gradfun
|
||||
@@ -5574,62 +5565,8 @@ value.
|
||||
|
||||
Detect video interlacing type.
|
||||
|
||||
This filter tries to detect if the input frames as interlaced, progressive,
|
||||
top or bottom field first. It will also try and detect fields that are
|
||||
repeated between adjacent frames (a sign of telecine).
|
||||
|
||||
Single frame detection considers only immediately adjacent frames when classifying each frame.
|
||||
Multiple frame detection incorporates the classification history of previous frames.
|
||||
|
||||
The filter will log these metadata values:
|
||||
|
||||
@table @option
|
||||
@item single.current_frame
|
||||
Detected type of current frame using single-frame detection. One of:
|
||||
``tff'' (top field first), ``bff'' (bottom field first),
|
||||
``progressive'', or ``undetermined''
|
||||
|
||||
@item single.tff
|
||||
Cumulative number of frames detected as top field first using single-frame detection.
|
||||
|
||||
@item multiple.tff
|
||||
Cumulative number of frames detected as top field first using multiple-frame detection.
|
||||
|
||||
@item single.bff
|
||||
Cumulative number of frames detected as bottom field first using single-frame detection.
|
||||
|
||||
@item multiple.current_frame
|
||||
Detected type of current frame using multiple-frame detection. One of:
|
||||
``tff'' (top field first), ``bff'' (bottom field first),
|
||||
``progressive'', or ``undetermined''
|
||||
|
||||
@item multiple.bff
|
||||
Cumulative number of frames detected as bottom field first using multiple-frame detection.
|
||||
|
||||
@item single.progressive
|
||||
Cumulative number of frames detected as progressive using single-frame detection.
|
||||
|
||||
@item multiple.progressive
|
||||
Cumulative number of frames detected as progressive using multiple-frame detection.
|
||||
|
||||
@item single.undetermined
|
||||
Cumulative number of frames that could not be classified using single-frame detection.
|
||||
|
||||
@item multiple.undetermined
|
||||
Cumulative number of frames that could not be classified using multiple-frame detection.
|
||||
|
||||
@item repeated.current_frame
|
||||
Which field in the current frame is repeated from the last. One of ``neither'', ``top'', or ``bottom''.
|
||||
|
||||
@item repeated.neither
|
||||
Cumulative number of frames with no repeated field.
|
||||
|
||||
@item repeated.top
|
||||
Cumulative number of frames with the top field repeated from the previous frame's top field.
|
||||
|
||||
@item repeated.bottom
|
||||
Cumulative number of frames with the bottom field repeated from the previous frame's bottom field.
|
||||
@end table
|
||||
This filter tries to detect if the input is interlaced or progressive,
|
||||
top or bottom field first.
|
||||
|
||||
The filter accepts the following options:
|
||||
|
||||
@@ -5638,13 +5575,6 @@ The filter accepts the following options:
|
||||
Set interlacing threshold.
|
||||
@item prog_thres
|
||||
Set progressive threshold.
|
||||
@item repeat_thres
|
||||
Threshold for repeated field detection.
|
||||
@item half_life
|
||||
Number of frames after which a given frame's contribution to the
|
||||
statistics is halved (i.e., it contributes only 0.5 to it's
|
||||
classification). The default of 0 means that all frames seen are given
|
||||
full weight of 1.0 forever.
|
||||
@end table
|
||||
|
||||
@section il
|
||||
@@ -6291,7 +6221,7 @@ values are assumed.
|
||||
|
||||
Refer to the official libopencv documentation for more precise
|
||||
information:
|
||||
@url{http://docs.opencv.org/master/modules/imgproc/doc/filtering.html}
|
||||
@url{http://opencv.willowgarage.com/documentation/c/image_filtering.html}
|
||||
|
||||
Several libopencv filters are supported; see the following subsections.
|
||||
|
||||
@@ -6783,9 +6713,6 @@ A description of the accepted parameters follows.
|
||||
@item y3
|
||||
Set coordinates expression for top left, top right, bottom left and bottom right corners.
|
||||
Default values are @code{0:0:W:0:0:H:W:H} with which perspective will remain unchanged.
|
||||
If the @code{sense} option is set to @code{source}, then the specified points will be sent
|
||||
to the corners of the destination. If the @code{sense} option is set to @code{destination},
|
||||
then the corners of the source will be sent to the specified coordinates.
|
||||
|
||||
The expressions can use the following variables:
|
||||
|
||||
@@ -6805,24 +6732,6 @@ It accepts the following values:
|
||||
@end table
|
||||
|
||||
Default value is @samp{linear}.
|
||||
|
||||
@item sense
|
||||
Set interpretation of coordinate options.
|
||||
|
||||
It accepts the following values:
|
||||
@table @samp
|
||||
@item 0, source
|
||||
|
||||
Send point in the source specified by the given coordinates to
|
||||
the corners of the destination.
|
||||
|
||||
@item 1, destination
|
||||
|
||||
Send the corners of the source to the point in the destination specified
|
||||
by the given coordinates.
|
||||
|
||||
Default value is @samp{source}.
|
||||
@end table
|
||||
@end table
|
||||
|
||||
@section phase
|
||||
@@ -8737,7 +8646,6 @@ ffmpeg -i INPUT -vf trim=duration=1
|
||||
@end itemize
|
||||
|
||||
|
||||
@anchor{unsharp}
|
||||
@section unsharp
|
||||
|
||||
Sharpen or blur the input video.
|
||||
@@ -8899,7 +8807,7 @@ Read a file with transform information for each frame and
|
||||
apply/compensate them. Together with the @ref{vidstabdetect}
|
||||
filter this can be used to deshake videos. See also
|
||||
@url{http://public.hronopik.de/vid.stab}. It is important to also use
|
||||
the @ref{unsharp} filter, see below.
|
||||
the unsharp filter, see below.
|
||||
|
||||
To enable compilation of this filter you need to configure FFmpeg with
|
||||
@code{--enable-libvidstab}.
|
||||
@@ -8909,7 +8817,7 @@ To enable compilation of this filter you need to configure FFmpeg with
|
||||
@table @option
|
||||
@item input
|
||||
Set path to the file used to read the transforms. Default value is
|
||||
@file{transforms.trf}.
|
||||
@file{transforms.trf}).
|
||||
|
||||
@item smoothing
|
||||
Set the number of frames (value*2 + 1) used for lowpass filtering the
|
||||
@@ -8917,9 +8825,9 @@ camera movements. Default value is 10.
|
||||
|
||||
For example a number of 10 means that 21 frames are used (10 in the
|
||||
past and 10 in the future) to smoothen the motion in the video. A
|
||||
larger value leads to a smoother video, but limits the acceleration of
|
||||
the camera (pan/tilt movements). 0 is a special case where a static
|
||||
camera is simulated.
|
||||
larger values leads to a smoother video, but limits the acceleration
|
||||
of the camera (pan/tilt movements). 0 is a special case where a
|
||||
static camera is simulated.
|
||||
|
||||
@item optalgo
|
||||
Set the camera path optimization algorithm.
|
||||
@@ -8956,7 +8864,7 @@ fill the border black
|
||||
Invert transforms if set to 1. Default value is 0.
|
||||
|
||||
@item relative
|
||||
Consider transforms as relative to previous frame if set to 1,
|
||||
Consider transforms as relative to previsou frame if set to 1,
|
||||
absolute if set to 0. Default value is 0.
|
||||
|
||||
@item zoom
|
||||
@@ -9022,7 +8930,7 @@ Use @command{ffmpeg} for a typical stabilization with default values:
|
||||
ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
|
||||
@end example
|
||||
|
||||
Note the use of the @ref{unsharp} filter which is always recommended.
|
||||
Note the use of the unsharp filter which is always recommended.
|
||||
|
||||
@item
|
||||
Zoom in a bit more and load transform data from a given file:
|
||||
@@ -9196,20 +9104,6 @@ Only deinterlace frames marked as interlaced.
|
||||
Default value is @samp{all}.
|
||||
@end table
|
||||
|
||||
@section xbr
|
||||
Apply the xBR high-quality magnification filter which is designed for pixel
|
||||
art. It follows a set of edge-detection rules, see
|
||||
@url{http://www.libretro.com/forums/viewtopic.php?f=6&t=134}.
|
||||
|
||||
It accepts the following option:
|
||||
|
||||
@table @option
|
||||
@item n
|
||||
Set the scaling dimension: @code{2} for @code{2xBR}, @code{3} for
|
||||
@code{3xBR} and @code{4} for @code{4xBR}.
|
||||
Default is @code{3}.
|
||||
@end table
|
||||
|
||||
@anchor{yadif}
|
||||
@section yadif
|
||||
|
||||
|
@@ -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.
|
||||
|
||||
@@ -55,10 +55,6 @@ Do not merge side data.
|
||||
Enable RTP MP4A-LATM payload.
|
||||
@item nobuffer
|
||||
Reduce the latency introduced by optional buffering
|
||||
@item bitexact
|
||||
Only write platform-, build- and time-independent data.
|
||||
This ensures that file and data checksums are reproducible and match between
|
||||
platforms. Its primary use is for regression testing.
|
||||
@end table
|
||||
|
||||
@item seek2any @var{integer} (@emph{input})
|
||||
@@ -67,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})
|
||||
@@ -172,18 +168,6 @@ The offset is added by the muxer to the output timestamps.
|
||||
Specifying a positive offset means that the corresponding streams are
|
||||
delayed bt the time duration specified in @var{offset}. Default value
|
||||
is @code{0} (meaning that no offset is applied).
|
||||
|
||||
@item format_whitelist @var{list} (@emph{input})
|
||||
"," separated List of allowed demuxers. By default all are allowed.
|
||||
|
||||
@item dump_separator @var{string} (@emph{input})
|
||||
Separator used to separate the fields printed on the command line about the
|
||||
Stream parameters.
|
||||
For example to separate the fields with newlines and indention:
|
||||
@example
|
||||
ffprobe -dump_separator "
|
||||
" -i ~/videos/matrixbench_mpeg2.mpg
|
||||
@end example
|
||||
@end table
|
||||
|
||||
@c man end FORMAT OPTIONS
|
||||
|
@@ -454,7 +454,6 @@ library:
|
||||
@item Sony Wave64 (W64) @tab X @tab X
|
||||
@item SoX native format @tab X @tab X
|
||||
@item SUN AU format @tab X @tab X
|
||||
@item SUP raw PGS subtitles @tab @tab X
|
||||
@item Text files @tab @tab X
|
||||
@item THP @tab @tab X
|
||||
@tab Used on the Nintendo GameCube.
|
||||
@@ -936,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
|
||||
@@ -1031,7 +1030,6 @@ performance on systems without hardware floating point support).
|
||||
@item PJS (Phoenix) @tab @tab X @tab @tab X
|
||||
@item RealText @tab @tab X @tab @tab X
|
||||
@item SAMI @tab @tab X @tab @tab X
|
||||
@item Spruce format (STL) @tab @tab X @tab @tab X
|
||||
@item SSA/ASS @tab X @tab X @tab X @tab X
|
||||
@item SubRip (SRT) @tab X @tab X @tab X @tab X
|
||||
@item SubViewer v1 @tab @tab X @tab @tab X
|
||||
|
144
doc/indevs.texi
144
doc/indevs.texi
@@ -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
|
||||
@@ -58,94 +58,34 @@ AVFoundation input device.
|
||||
AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX >= 10.7 as well as on iOS.
|
||||
The older QTKit framework has been marked deprecated since OSX version 10.7.
|
||||
|
||||
The input filename has to be given in the following syntax:
|
||||
@example
|
||||
-i "[[VIDEO]:[AUDIO]]"
|
||||
@end example
|
||||
The first entry selects the video input while the latter selects the audio input.
|
||||
The stream has to be specified by the device name or the device index as shown by the device list.
|
||||
Alternatively, the video and/or audio input device can be chosen by index using the
|
||||
@option{
|
||||
-video_device_index <INDEX>
|
||||
}
|
||||
and/or
|
||||
@option{
|
||||
-audio_device_index <INDEX>
|
||||
}
|
||||
, overriding any
|
||||
device name or index given in the input filename.
|
||||
|
||||
All available devices can be enumerated by using @option{-list_devices true}, listing
|
||||
all device names and corresponding indices.
|
||||
|
||||
There are two device name aliases:
|
||||
@table @code
|
||||
|
||||
@item default
|
||||
Select the AVFoundation default device of the corresponding type.
|
||||
|
||||
@item none
|
||||
Do not record the corresponding media type.
|
||||
This is equivalent to specifying an empty device name or index.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Options
|
||||
|
||||
AVFoundation supports the following options:
|
||||
|
||||
@table @option
|
||||
|
||||
@item -list_devices <TRUE|FALSE>
|
||||
If set to true, a list of all available input devices is given showing all
|
||||
device names and indices.
|
||||
|
||||
@item -video_device_index <INDEX>
|
||||
Specify the video device by its index. Overrides anything given in the input filename.
|
||||
|
||||
@item -audio_device_index <INDEX>
|
||||
Specify the audio device by its index. Overrides anything given in the input filename.
|
||||
|
||||
@item -pixel_format <FORMAT>
|
||||
Request the video device to use a specific pixel format.
|
||||
If the specified format is not supported, a list of available formats is given
|
||||
und the first one in this list is used instead. Available pixel formats are:
|
||||
@code{monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
|
||||
The filename passed as input is parsed to contain either a device name or index.
|
||||
The device index can also be given by using -video_device_index.
|
||||
A given device index will override any given device name.
|
||||
If the desired device consists of numbers only, use -video_device_index to identify it.
|
||||
The default device will be chosen if an empty string or the device name "default" is given.
|
||||
The available devices can be enumerated by using -list_devices.
|
||||
The pixel format can be set using -pixel_format.
|
||||
Available formats:
|
||||
monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
|
||||
bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
|
||||
yuv420p, nv12, yuyv422, gray}
|
||||
yuv420p, nv12, yuyv422, gray
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
|
||||
@item
|
||||
Print the list of AVFoundation supported devices and exit:
|
||||
@example
|
||||
$ ffmpeg -f avfoundation -list_devices true -i ""
|
||||
ffmpeg -f avfoundation -i "0" out.mpg
|
||||
@end example
|
||||
|
||||
@item
|
||||
Record video from video device 0 and audio from audio device 0 into out.avi:
|
||||
@example
|
||||
$ ffmpeg -f avfoundation -i "0:0" out.avi
|
||||
ffmpeg -f avfoundation -video_device_index 0 -i "" out.mpg
|
||||
@end example
|
||||
|
||||
@item
|
||||
Record video from video device 2 and audio from audio device 1 into out.avi:
|
||||
@example
|
||||
$ ffmpeg -f avfoundation -video_device_index 2 -i ":1" out.avi
|
||||
ffmpeg -f avfoundation -pixel_format bgr0 -i "default" out.mpg
|
||||
@end example
|
||||
|
||||
@item
|
||||
Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
|
||||
@example
|
||||
$ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
|
||||
ffmpeg -f avfoundation -list_devices true -i ""
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
@section bktr
|
||||
|
||||
BSD video input device.
|
||||
@@ -982,58 +922,4 @@ 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
|
||||
|
||||
@section decklink
|
||||
|
||||
The decklink input device provides capture capabilities for Blackmagic
|
||||
DeckLink devices.
|
||||
|
||||
To enable this input device, you need the Blackmagic DeckLink SDK and you
|
||||
need to configure with the appropriate @code{--extra-cflags}
|
||||
and @code{--extra-ldflags}.
|
||||
On Windows, you need to run the IDL files through @command{widl}.
|
||||
|
||||
DeckLink is very picky about the formats it supports. Pixel format is always
|
||||
uyvy422, framerate and video size must be determined for your device with
|
||||
@command{-list_formats 1}. Audio sample rate is always 48 kHz and the number
|
||||
of channels currently is limited to 2 (stereo).
|
||||
|
||||
@subsection Options
|
||||
|
||||
@table @option
|
||||
|
||||
@item list_devices
|
||||
If set to @option{true}, print a list of devices and exit.
|
||||
Defaults to @option{false}.
|
||||
|
||||
@item list_formats
|
||||
If set to @option{true}, print a list of supported formats and exit.
|
||||
Defaults to @option{false}.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
|
||||
@item
|
||||
List input devices:
|
||||
@example
|
||||
ffmpeg -f decklink -list_devices 1 -i dummy
|
||||
@end example
|
||||
|
||||
@item
|
||||
List supported formats:
|
||||
@example
|
||||
ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
|
||||
@end example
|
||||
|
||||
@item
|
||||
Capture video clip at 1080i50 (format 11):
|
||||
@example
|
||||
ffmpeg -f decklink -i 'Intensity Pro@@11' -acodec copy -vcodec copy output.avi
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
|
||||
@c man end INPUT DEVICES
|
||||
|
@@ -194,19 +194,15 @@ can not be smaller than one centi second.
|
||||
Apple HTTP Live Streaming muxer that segments MPEG-TS according to
|
||||
the HTTP Live Streaming (HLS) specification.
|
||||
|
||||
It creates a playlist file, and one or more segment files. The output filename
|
||||
specifies the playlist filename.
|
||||
|
||||
By default, the muxer creates a file for each segment produced. These files
|
||||
have the same name as the playlist, followed by a sequential number and a
|
||||
.ts extension.
|
||||
It creates a playlist file and numbered segment files. The output
|
||||
filename specifies the playlist filename; the segment filenames
|
||||
receive the same basename as the playlist, a sequential number and
|
||||
a .ts extension.
|
||||
|
||||
For example, to convert an input file with @command{ffmpeg}:
|
||||
@example
|
||||
ffmpeg -i in.nut out.m3u8
|
||||
@end example
|
||||
This example will produce the playlist, @file{out.m3u8}, and segment files:
|
||||
@file{out0.ts}, @file{out1.ts}, @file{out2.ts}, etc.
|
||||
|
||||
See also the @ref{segment} muxer, which provides a more generic and
|
||||
flexible implementation of a segmenter, and can be used to perform HLS
|
||||
@@ -224,11 +220,6 @@ Set the segment length in seconds. Default value is 2.
|
||||
Set the maximum number of playlist entries. If set to 0 the list file
|
||||
will contain all the segments. Default value is 5.
|
||||
|
||||
@item hls_ts_options @var{options_list}
|
||||
Set output format options using a :-separated list of key=value
|
||||
parameters. Values containing @code{:} special characters must be
|
||||
escaped.
|
||||
|
||||
@item hls_wrap @var{wrap}
|
||||
Set the number after which the segment filename number (the number
|
||||
specified in each segment file) wraps. If set to 0 the number will be
|
||||
@@ -242,9 +233,6 @@ to @var{wrap}.
|
||||
Start the playlist sequence number from @var{number}. Default value is
|
||||
0.
|
||||
|
||||
@item hls_allow_cache @var{allowcache}
|
||||
Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
|
||||
|
||||
@item hls_base_url @var{baseurl}
|
||||
Append @var{baseurl} to every entry in the playlist.
|
||||
Useful to generate playlists with absolute paths.
|
||||
@@ -253,17 +241,6 @@ Note that the playlist sequence number must be unique for each segment
|
||||
and it is not to be confused with the segment filename sequence number
|
||||
which can be cyclic, for example if the @option{wrap} option is
|
||||
specified.
|
||||
|
||||
@item hls_flags single_file
|
||||
If this flag is set, the muxer will store all segments in a single MPEG-TS
|
||||
file, and will use byte ranges in the playlist. HLS playlists generated with
|
||||
this way will have the version number 4.
|
||||
For example:
|
||||
@example
|
||||
ffmpeg -i in.nut -hls_flags single_file out.m3u8
|
||||
@end example
|
||||
Will produce the playlist, @file{out.m3u8}, and a single segment file,
|
||||
@file{out.ts}.
|
||||
@end table
|
||||
|
||||
@anchor{ico}
|
||||
@@ -559,6 +536,7 @@ a short portion of the file. With this option set, there is no initial
|
||||
mdat atom, and the moov atom only describes the tracks but has
|
||||
a zero duration.
|
||||
|
||||
Files written with this option set do not work in QuickTime.
|
||||
This option is implicitly set when writing ismv (Smooth Streaming) files.
|
||||
@item -movflags separate_moof
|
||||
Write a separate moof (movie fragment) atom for each track. Normally,
|
||||
@@ -579,16 +557,6 @@ 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.
|
||||
@item -movflags omit_tfhd_offset
|
||||
Do not write any absolute base_data_offset in tfhd atoms. This avoids
|
||||
tying fragments to absolute byte positions in the file/streams.
|
||||
@item -movflags default_base_moof
|
||||
Similarly to the omit_tfhd_offset, this flag avoids writing the
|
||||
absolute base_data_offset field in tfhd atoms, but does so by using
|
||||
the new default-base-is-moof flag instead. This flag is new from
|
||||
14496-12:2012. This may make the fragments easier to parse in certain
|
||||
circumstances (avoiding basing track fragment location calculations
|
||||
on the implicit end of the previous track fragment).
|
||||
@end table
|
||||
|
||||
@subsection Example
|
||||
@@ -601,38 +569,29 @@ ffmpeg -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe
|
||||
|
||||
@section mp3
|
||||
|
||||
The MP3 muxer writes a raw MP3 stream with the following optional features:
|
||||
@itemize @bullet
|
||||
@item
|
||||
An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
|
||||
2.4 are supported, the @code{id3v2_version} private option controls which one is
|
||||
used (3 or 4). Setting @code{id3v2_version} to 0 disables the ID3v2 header
|
||||
completely.
|
||||
The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
|
||||
optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
|
||||
@code{id3v2_version} option controls which one is used. Setting
|
||||
@code{id3v2_version} to 0 will disable the ID3v2 header completely. The legacy
|
||||
ID3v1 tag is not written by default, but may be enabled with the
|
||||
@code{write_id3v1} option.
|
||||
|
||||
The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
|
||||
The pictures are supplied to the muxer in form of a video stream with a single
|
||||
packet. There can be any number of those streams, each will correspond to a
|
||||
single APIC frame. The stream metadata tags @var{title} and @var{comment} map
|
||||
to APIC @var{description} and @var{picture type} respectively. See
|
||||
The muxer may also write a Xing frame at the beginning, which contains the
|
||||
number of frames in the file. It is useful for computing duration of VBR files.
|
||||
The Xing frame is written if the output stream is seekable and if the
|
||||
@code{write_xing} option is set to 1 (the default).
|
||||
|
||||
The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
|
||||
are supplied to the muxer in form of a video stream with a single packet. There
|
||||
can be any number of those streams, each will correspond to a single APIC frame.
|
||||
The stream metadata tags @var{title} and @var{comment} map to APIC
|
||||
@var{description} and @var{picture type} respectively. See
|
||||
@url{http://id3.org/id3v2.4.0-frames} for allowed picture types.
|
||||
|
||||
Note that the APIC frames must be written at the beginning, so the muxer will
|
||||
buffer the audio frames until it gets all the pictures. It is therefore advised
|
||||
to provide the pictures as soon as possible to avoid excessive buffering.
|
||||
|
||||
@item
|
||||
A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
|
||||
default, but will be written only if the output is seekable. The
|
||||
@code{write_xing} private option can be used to disable it. The frame contains
|
||||
various information that may be useful to the decoder, like the audio duration
|
||||
or encoder delay.
|
||||
|
||||
@item
|
||||
A legacy ID3v1 tag at the end of the file (disabled by default). It may be
|
||||
enabled with the @code{write_id3v1} private option, but as its capabilities are
|
||||
very limited, its usage is not recommended.
|
||||
@end itemize
|
||||
|
||||
Examples:
|
||||
|
||||
Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
|
||||
|
@@ -135,6 +135,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
|
||||
@@ -281,7 +283,7 @@ binutils, gcc4-core, make, git, mingw-runtime, texinfo
|
||||
|
||||
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
|
||||
|
@@ -26,10 +26,6 @@
|
||||
#include <string.h>
|
||||
#include <float.h>
|
||||
|
||||
// print_options is build for the host, os_support.h isn't needed and is setup
|
||||
// for the target. without this build breaks on mingw
|
||||
#define AVFORMAT_OS_SUPPORT_H
|
||||
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/options_table.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
|
@@ -750,7 +750,7 @@ port will be used for the local RTP and RTCP ports.
|
||||
|
||||
@item
|
||||
If @option{localrtcpport} (the local RTCP port) is not set it will be
|
||||
set to the local RTP port value plus 1.
|
||||
set to the the local RTP port value plus 1.
|
||||
@end enumerate
|
||||
|
||||
@section rtsp
|
||||
@@ -1081,8 +1081,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
|
||||
|
@@ -14,9 +14,9 @@
|
||||
# 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.
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public
|
||||
# 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
|
||||
|
||||
|
@@ -844,7 +844,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 +861,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 +912,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.
|
||||
|
@@ -16,15 +16,16 @@ outputs the modified frame. The most simple way of doing this is to take a
|
||||
similar filter. We'll pick edgedetect, but any other should do. You can look
|
||||
for others using the `./ffmpeg -v 0 -filters|grep ' V->V '` command.
|
||||
|
||||
- sed 's/edgedetect/foobar/g;s/EdgeDetect/Foobar/g' libavfilter/vf_edgedetect.c > libavfilter/vf_foobar.c
|
||||
- cp libavfilter/vf_{edgedetect,foobar}.c
|
||||
- sed -i s/edgedetect/foobar/g -i libavfilter/vf_foobar.c
|
||||
- sed -i s/EdgeDetect/Foobar/g -i libavfilter/vf_foobar.c
|
||||
- edit libavfilter/Makefile, and add an entry for "foobar" following the
|
||||
pattern of the other filters.
|
||||
- edit libavfilter/allfilters.c, and add an entry for "foobar" following the
|
||||
pattern of the other filters.
|
||||
- ./configure ...
|
||||
- make -j<whatever> ffmpeg
|
||||
- ./ffmpeg -i http://samples.ffmpeg.org/image-samples/lena.pnm -vf foobar foobar.png
|
||||
Note here: you can obviously use a random local image instead of a remote URL.
|
||||
- ./ffmpeg -i tests/lena.pnm -vf foobar foobar.png
|
||||
|
||||
If everything went right, you should get a foobar.png with Lena edge-detected.
|
||||
|
||||
|
237
ffmpeg.c
237
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);
|
||||
@@ -479,7 +475,6 @@ static void ffmpeg_cleanup(int ret)
|
||||
}
|
||||
ost->bitstream_filters = NULL;
|
||||
av_frame_free(&ost->filtered_frame);
|
||||
av_frame_free(&ost->last_frame);
|
||||
|
||||
av_parser_close(ost->parser);
|
||||
|
||||
@@ -627,11 +622,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
|
||||
|
||||
while (bsfc) {
|
||||
AVPacket new_pkt = *pkt;
|
||||
AVDictionaryEntry *bsf_arg = av_dict_get(ost->bsf_args,
|
||||
bsfc->filter->name,
|
||||
NULL, 0);
|
||||
int a = av_bitstream_filter_filter(bsfc, avctx,
|
||||
bsf_arg ? bsf_arg->value : NULL,
|
||||
int a = av_bitstream_filter_filter(bsfc, avctx, NULL,
|
||||
&new_pkt.data, &new_pkt.size,
|
||||
pkt->data, pkt->size,
|
||||
pkt->flags & AV_PKT_FLAG_KEY);
|
||||
@@ -655,7 +646,6 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
|
||||
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");
|
||||
@@ -669,17 +659,6 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
|
||||
}
|
||||
|
||||
if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
|
||||
if (pkt->dts != AV_NOPTS_VALUE &&
|
||||
pkt->pts != AV_NOPTS_VALUE &&
|
||||
pkt->dts > pkt->pts) {
|
||||
av_log(s, AV_LOG_WARNING, "Invalid DTS: %"PRId64" PTS: %"PRId64" in output stream %d:%d, replacing by guess\n",
|
||||
pkt->dts, pkt->pts,
|
||||
ost->file_index, ost->st->index);
|
||||
pkt->pts =
|
||||
pkt->dts = pkt->pts + pkt->dts + ost->last_mux_dts + 1
|
||||
- FFMIN3(pkt->pts, pkt->dts, ost->last_mux_dts + 1)
|
||||
- FFMAX3(pkt->pts, pkt->dts, ost->last_mux_dts + 1);
|
||||
}
|
||||
if(
|
||||
(avctx->codec_type == AVMEDIA_TYPE_AUDIO || avctx->codec_type == AVMEDIA_TYPE_VIDEO) &&
|
||||
pkt->dts != AV_NOPTS_VALUE &&
|
||||
@@ -702,6 +681,15 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
|
||||
pkt->dts = max;
|
||||
}
|
||||
}
|
||||
if (pkt->dts != AV_NOPTS_VALUE &&
|
||||
pkt->pts != AV_NOPTS_VALUE &&
|
||||
pkt->dts > pkt->pts) {
|
||||
av_log(s, AV_LOG_WARNING, "Invalid DTS: %"PRId64" PTS: %"PRId64" in output stream %d:%d\n",
|
||||
pkt->dts, pkt->pts,
|
||||
ost->file_index, ost->st->index);
|
||||
pkt->pts = AV_NOPTS_VALUE;
|
||||
pkt->dts = AV_NOPTS_VALUE;
|
||||
}
|
||||
}
|
||||
ost->last_mux_dts = pkt->dts;
|
||||
|
||||
@@ -884,14 +872,14 @@ static void do_subtitle_out(AVFormatContext *s,
|
||||
|
||||
static void do_video_out(AVFormatContext *s,
|
||||
OutputStream *ost,
|
||||
AVFrame *next_picture)
|
||||
AVFrame *in_picture)
|
||||
{
|
||||
int ret, format_video_sync;
|
||||
AVPacket pkt;
|
||||
AVCodecContext *enc = ost->enc_ctx;
|
||||
AVCodecContext *mux_enc = ost->st->codec;
|
||||
int nb_frames, nb0_frames, i;
|
||||
double sync_ipts, delta, delta0;
|
||||
int nb_frames, i;
|
||||
double sync_ipts, delta;
|
||||
double duration = 0;
|
||||
int frame_size = 0;
|
||||
InputStream *ist = NULL;
|
||||
@@ -902,20 +890,10 @@ static void do_video_out(AVFormatContext *s,
|
||||
if(ist && ist->st->start_time != AV_NOPTS_VALUE && ist->st->first_dts != AV_NOPTS_VALUE && ost->frame_rate.num)
|
||||
duration = 1/(av_q2d(ost->frame_rate) * av_q2d(enc->time_base));
|
||||
|
||||
if (!ost->filters_script &&
|
||||
!ost->filters &&
|
||||
next_picture &&
|
||||
ist &&
|
||||
lrintf(av_frame_get_pkt_duration(next_picture) * av_q2d(ist->st->time_base) / av_q2d(enc->time_base)) > 0) {
|
||||
duration = lrintf(av_frame_get_pkt_duration(next_picture) * av_q2d(ist->st->time_base) / av_q2d(enc->time_base));
|
||||
}
|
||||
|
||||
sync_ipts = next_picture->pts;
|
||||
delta0 = sync_ipts - ost->sync_opts;
|
||||
delta = delta0 + duration;
|
||||
sync_ipts = in_picture->pts;
|
||||
delta = sync_ipts - ost->sync_opts + duration;
|
||||
|
||||
/* by default, we output a single frame */
|
||||
nb0_frames = 0;
|
||||
nb_frames = 1;
|
||||
|
||||
format_video_sync = video_sync_method;
|
||||
@@ -935,34 +913,19 @@ static void do_video_out(AVFormatContext *s,
|
||||
}
|
||||
}
|
||||
|
||||
if (delta0 < 0 &&
|
||||
delta > 0 &&
|
||||
format_video_sync != VSYNC_PASSTHROUGH &&
|
||||
format_video_sync != VSYNC_DROP) {
|
||||
double cor = FFMIN(-delta0, duration);
|
||||
av_log(NULL, AV_LOG_WARNING, "Past duration %f too large\n", -delta0);
|
||||
sync_ipts += cor;
|
||||
duration -= cor;
|
||||
delta0 += cor;
|
||||
}
|
||||
|
||||
switch (format_video_sync) {
|
||||
case VSYNC_VSCFR:
|
||||
if (ost->frame_number == 0 && delta - duration >= 0.5) {
|
||||
av_log(NULL, AV_LOG_DEBUG, "Not duplicating %d initial frames\n", (int)lrintf(delta - duration));
|
||||
delta = duration;
|
||||
delta0 = 0;
|
||||
ost->sync_opts = lrint(sync_ipts);
|
||||
}
|
||||
case VSYNC_CFR:
|
||||
// FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c
|
||||
if (delta < -1.1)
|
||||
nb_frames = 0;
|
||||
else if (delta > 1.1) {
|
||||
else if (delta > 1.1)
|
||||
nb_frames = lrintf(delta);
|
||||
if (delta0 > 1.1)
|
||||
nb0_frames = lrintf(delta0 - 0.6);
|
||||
}
|
||||
break;
|
||||
case VSYNC_VFR:
|
||||
if (delta <= -0.6)
|
||||
@@ -979,36 +942,28 @@ static void do_video_out(AVFormatContext *s,
|
||||
}
|
||||
|
||||
nb_frames = FFMIN(nb_frames, ost->max_frames - ost->frame_number);
|
||||
nb0_frames = FFMIN(nb0_frames, nb_frames);
|
||||
if (nb0_frames == 0 && ost->last_droped) {
|
||||
if (nb_frames == 0) {
|
||||
nb_frames_drop++;
|
||||
av_log(NULL, AV_LOG_VERBOSE,
|
||||
"*** dropping frame %d from stream %d at ts %"PRId64"\n",
|
||||
ost->frame_number, ost->st->index, ost->last_frame->pts);
|
||||
}
|
||||
if (nb_frames > (nb0_frames && ost->last_droped) + (nb_frames > nb0_frames)) {
|
||||
ost->frame_number, ost->st->index, in_picture->pts);
|
||||
return;
|
||||
} else if (nb_frames > 1) {
|
||||
if (nb_frames > dts_error_threshold * 30) {
|
||||
av_log(NULL, AV_LOG_ERROR, "%d frame duplication too large, skipping\n", nb_frames - 1);
|
||||
nb_frames_drop++;
|
||||
return;
|
||||
}
|
||||
nb_frames_dup += nb_frames - (nb0_frames && ost->last_droped) - (nb_frames > nb0_frames);
|
||||
nb_frames_dup += nb_frames - 1;
|
||||
av_log(NULL, AV_LOG_VERBOSE, "*** %d dup!\n", nb_frames - 1);
|
||||
}
|
||||
ost->last_droped = nb_frames == nb0_frames;
|
||||
|
||||
/* duplicates frame if needed */
|
||||
for (i = 0; i < nb_frames; i++) {
|
||||
AVFrame *in_picture;
|
||||
av_init_packet(&pkt);
|
||||
pkt.data = NULL;
|
||||
pkt.size = 0;
|
||||
|
||||
if (i < nb0_frames && ost->last_frame) {
|
||||
in_picture = ost->last_frame;
|
||||
} else
|
||||
in_picture = next_picture;
|
||||
|
||||
in_picture->pts = ost->sync_opts;
|
||||
|
||||
#if 1
|
||||
@@ -1023,8 +978,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;
|
||||
@@ -1050,7 +1007,8 @@ static void do_video_out(AVFormatContext *s,
|
||||
mux_enc->field_order = AV_FIELD_PROGRESSIVE;
|
||||
|
||||
in_picture->quality = enc->global_quality;
|
||||
in_picture->pict_type = 0;
|
||||
if (!enc->me_threshold)
|
||||
in_picture->pict_type = 0;
|
||||
|
||||
pts_time = in_picture->pts != AV_NOPTS_VALUE ?
|
||||
in_picture->pts * av_q2d(enc->time_base) : NAN;
|
||||
@@ -1144,14 +1102,6 @@ static void do_video_out(AVFormatContext *s,
|
||||
if (vstats_filename && frame_size)
|
||||
do_video_stats(ost, frame_size);
|
||||
}
|
||||
|
||||
if (!ost->last_frame)
|
||||
ost->last_frame = av_frame_alloc();
|
||||
av_frame_unref(ost->last_frame);
|
||||
if (next_picture && ost->last_frame)
|
||||
av_frame_ref(ost->last_frame, next_picture);
|
||||
else
|
||||
av_frame_free(&ost->last_frame);
|
||||
}
|
||||
|
||||
static double psnr(double d)
|
||||
@@ -1320,6 +1270,7 @@ static void print_final_stats(int64_t total_size)
|
||||
if (data_size && total_size>0 && total_size >= data_size)
|
||||
percent = 100.0 * (total_size - data_size) / data_size;
|
||||
|
||||
av_log(NULL, AV_LOG_INFO, "\n");
|
||||
av_log(NULL, AV_LOG_INFO, "video:%1.0fkB audio:%1.0fkB subtitle:%1.0fkB other streams:%1.0fkB global headers:%1.0fkB muxing overhead: ",
|
||||
video_size / 1024.0,
|
||||
audio_size / 1024.0,
|
||||
@@ -1510,8 +1461,6 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
|
||||
if (av_stream_get_end_pts(ost->st) != AV_NOPTS_VALUE)
|
||||
pts = FFMAX(pts, av_rescale_q(av_stream_get_end_pts(ost->st),
|
||||
ost->st->time_base, AV_TIME_BASE_Q));
|
||||
if (is_last_report)
|
||||
nb_frames_drop += ost->last_droped;
|
||||
}
|
||||
|
||||
secs = pts / AV_TIME_BASE;
|
||||
@@ -1547,11 +1496,10 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
|
||||
av_bprintf(&buf_script, "drop_frames=%d\n", nb_frames_drop);
|
||||
|
||||
if (print_stats || is_last_report) {
|
||||
const char end = is_last_report ? '\n' : '\r';
|
||||
if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
|
||||
fprintf(stderr, "%s %c", buf, end);
|
||||
fprintf(stderr, "%s \r", buf);
|
||||
} else
|
||||
av_log(NULL, AV_LOG_INFO, "%s %c", buf, end);
|
||||
av_log(NULL, AV_LOG_INFO, "%s \r", buf);
|
||||
|
||||
fflush(stderr);
|
||||
}
|
||||
@@ -1736,21 +1684,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);
|
||||
@@ -1761,15 +1705,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;
|
||||
@@ -1968,20 +1906,6 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
|
||||
if (*got_output || ret<0 || pkt->size)
|
||||
decode_error_stat[ret<0] ++;
|
||||
|
||||
if (*got_output && ret >= 0) {
|
||||
if (ist->dec_ctx->width != decoded_frame->width ||
|
||||
ist->dec_ctx->height != decoded_frame->height ||
|
||||
ist->dec_ctx->pix_fmt != decoded_frame->format) {
|
||||
av_log(NULL, AV_LOG_DEBUG, "Frame parameters mismatch context %d,%d,%d != %d,%d,%d\n",
|
||||
decoded_frame->width,
|
||||
decoded_frame->height,
|
||||
decoded_frame->format,
|
||||
ist->dec_ctx->width,
|
||||
ist->dec_ctx->height,
|
||||
ist->dec_ctx->pix_fmt);
|
||||
}
|
||||
}
|
||||
|
||||
if (!*got_output || ret < 0) {
|
||||
if (!pkt->size) {
|
||||
for (i = 0; i < ist->nb_filters; i++)
|
||||
@@ -2198,11 +2122,11 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
|
||||
ret = decode_video (ist, &avpkt, &got_output);
|
||||
if (avpkt.duration) {
|
||||
duration = av_rescale_q(avpkt.duration, ist->st->time_base, AV_TIME_BASE_Q);
|
||||
} else if(ist->dec_ctx->framerate.num != 0 && ist->dec_ctx->framerate.den != 0) {
|
||||
} else if(ist->dec_ctx->time_base.num != 0 && ist->dec_ctx->time_base.den != 0) {
|
||||
int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict+1 : ist->dec_ctx->ticks_per_frame;
|
||||
duration = ((int64_t)AV_TIME_BASE *
|
||||
ist->dec_ctx->framerate.den * ticks) /
|
||||
ist->dec_ctx->framerate.num / ist->dec_ctx->ticks_per_frame;
|
||||
ist->dec_ctx->time_base.num * ticks) /
|
||||
ist->dec_ctx->time_base.den;
|
||||
} else
|
||||
duration = 0;
|
||||
|
||||
@@ -2257,11 +2181,11 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
|
||||
ist->next_dts = av_rescale_q(next_dts + 1, av_inv_q(ist->framerate), time_base_q);
|
||||
} else if (pkt->duration) {
|
||||
ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);
|
||||
} else if(ist->dec_ctx->framerate.num != 0) {
|
||||
} else if(ist->dec_ctx->time_base.num != 0) {
|
||||
int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict + 1 : ist->dec_ctx->ticks_per_frame;
|
||||
ist->next_dts += ((int64_t)AV_TIME_BASE *
|
||||
ist->dec_ctx->framerate.den * ticks) /
|
||||
ist->dec_ctx->framerate.num / ist->dec_ctx->ticks_per_frame;
|
||||
ist->dec_ctx->time_base.num * ticks) /
|
||||
ist->dec_ctx->time_base.den;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2539,7 +2463,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++) {
|
||||
@@ -2638,13 +2562,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;
|
||||
|
||||
@@ -2699,26 +2621,6 @@ static int transcode_init(void)
|
||||
av_reduce(&enc_ctx->time_base.num, &enc_ctx->time_base.den,
|
||||
enc_ctx->time_base.num, enc_ctx->time_base.den, INT_MAX);
|
||||
|
||||
if (ist->st->nb_side_data) {
|
||||
ost->st->side_data = av_realloc_array(NULL, ist->st->nb_side_data,
|
||||
sizeof(*ist->st->side_data));
|
||||
if (!ost->st->side_data)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
for (j = 0; j < ist->st->nb_side_data; j++) {
|
||||
const AVPacketSideData *sd_src = &ist->st->side_data[j];
|
||||
AVPacketSideData *sd_dst = &ost->st->side_data[j];
|
||||
|
||||
sd_dst->data = av_malloc(sd_src->size);
|
||||
if (!sd_dst->data)
|
||||
return AVERROR(ENOMEM);
|
||||
memcpy(sd_dst->data, sd_src->data, sd_src->size);
|
||||
sd_dst->size = sd_src->size;
|
||||
sd_dst->type = sd_src->type;
|
||||
ost->st->nb_side_data++;
|
||||
}
|
||||
}
|
||||
|
||||
ost->parser = av_parser_init(enc_ctx->codec_id);
|
||||
|
||||
switch (enc_ctx->codec_type) {
|
||||
@@ -2733,10 +2635,7 @@ static int transcode_init(void)
|
||||
enc_ctx->frame_size = dec_ctx->frame_size;
|
||||
enc_ctx->audio_service_type = dec_ctx->audio_service_type;
|
||||
enc_ctx->block_align = dec_ctx->block_align;
|
||||
enc_ctx->initial_padding = dec_ctx->delay;
|
||||
#if FF_API_AUDIOENC_DELAY
|
||||
enc_ctx->delay = dec_ctx->delay;
|
||||
#endif
|
||||
if((enc_ctx->block_align == 1 || enc_ctx->block_align == 1152 || enc_ctx->block_align == 576) && enc_ctx->codec_id == AV_CODEC_ID_MP3)
|
||||
enc_ctx->block_align= 0;
|
||||
if(enc_ctx->codec_id == AV_CODEC_ID_AC3)
|
||||
@@ -2983,11 +2882,10 @@ static int transcode_init(void)
|
||||
av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low."
|
||||
" It takes bits/s as argument, not kbits/s\n");
|
||||
} else {
|
||||
ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);
|
||||
if (ret < 0) {
|
||||
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");
|
||||
return ret;
|
||||
exit_program(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3187,9 +3085,9 @@ static OutputStream *choose_output(void)
|
||||
OutputStream *ost = output_streams[i];
|
||||
int64_t opts = av_rescale_q(ost->st->cur_dts, ost->st->time_base,
|
||||
AV_TIME_BASE_Q);
|
||||
if (!ost->finished && opts < opts_min) {
|
||||
if (!ost->unavailable && !ost->finished && opts < opts_min) {
|
||||
opts_min = opts;
|
||||
ost_min = ost->unavailable ? NULL : ost;
|
||||
ost_min = ost;
|
||||
}
|
||||
}
|
||||
return ost_min;
|
||||
@@ -3567,14 +3465,13 @@ static int process_input(int file_index)
|
||||
if (pkt.dts != AV_NOPTS_VALUE)
|
||||
pkt.dts *= ist->ts_scale;
|
||||
|
||||
if ((ist->dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO ||
|
||||
ist->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) &&
|
||||
pkt.dts != AV_NOPTS_VALUE && ist->next_dts == AV_NOPTS_VALUE && !copy_ts
|
||||
if (pkt.dts != AV_NOPTS_VALUE && ist->next_dts == AV_NOPTS_VALUE && !copy_ts
|
||||
&& (is->iformat->flags & AVFMT_TS_DISCONT) && ifile->last_ts != AV_NOPTS_VALUE) {
|
||||
int64_t pkt_dts = av_rescale_q(pkt.dts, ist->st->time_base, AV_TIME_BASE_Q);
|
||||
int64_t delta = pkt_dts - ifile->last_ts;
|
||||
if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
|
||||
delta > 1LL*dts_delta_threshold*AV_TIME_BASE){
|
||||
if(delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
|
||||
(delta > 1LL*dts_delta_threshold*AV_TIME_BASE &&
|
||||
ist->dec_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE)){
|
||||
ifile->ts_offset -= delta;
|
||||
av_log(NULL, AV_LOG_DEBUG,
|
||||
"Inter stream timestamp discontinuity %"PRId64", new offset= %"PRId64"\n",
|
||||
@@ -3585,15 +3482,14 @@ static int process_input(int file_index)
|
||||
}
|
||||
}
|
||||
|
||||
if ((ist->dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO ||
|
||||
ist->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) &&
|
||||
pkt.dts != AV_NOPTS_VALUE && ist->next_dts != AV_NOPTS_VALUE &&
|
||||
if (pkt.dts != AV_NOPTS_VALUE && ist->next_dts != AV_NOPTS_VALUE &&
|
||||
!copy_ts) {
|
||||
int64_t pkt_dts = av_rescale_q(pkt.dts, ist->st->time_base, AV_TIME_BASE_Q);
|
||||
int64_t delta = pkt_dts - ist->next_dts;
|
||||
if (is->iformat->flags & AVFMT_TS_DISCONT) {
|
||||
if (delta < -1LL*dts_delta_threshold*AV_TIME_BASE ||
|
||||
delta > 1LL*dts_delta_threshold*AV_TIME_BASE ||
|
||||
(delta > 1LL*dts_delta_threshold*AV_TIME_BASE &&
|
||||
ist->dec_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE) ||
|
||||
pkt_dts + AV_TIME_BASE/10 < FFMAX(ist->pts, ist->dts)) {
|
||||
ifile->ts_offset -= delta;
|
||||
av_log(NULL, AV_LOG_DEBUG,
|
||||
@@ -3605,7 +3501,7 @@ static int process_input(int file_index)
|
||||
}
|
||||
} else {
|
||||
if ( delta < -1LL*dts_error_threshold*AV_TIME_BASE ||
|
||||
delta > 1LL*dts_error_threshold*AV_TIME_BASE) {
|
||||
(delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->dec_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE)) {
|
||||
av_log(NULL, AV_LOG_WARNING, "DTS %"PRId64", next:%"PRId64" st:%d invalid dropping\n", pkt.dts, ist->next_dts, pkt.stream_index);
|
||||
pkt.dts = AV_NOPTS_VALUE;
|
||||
}
|
||||
@@ -3613,7 +3509,7 @@ static int process_input(int file_index)
|
||||
int64_t pkt_pts = av_rescale_q(pkt.pts, ist->st->time_base, AV_TIME_BASE_Q);
|
||||
delta = pkt_pts - ist->next_dts;
|
||||
if ( delta < -1LL*dts_error_threshold*AV_TIME_BASE ||
|
||||
delta > 1LL*dts_error_threshold*AV_TIME_BASE) {
|
||||
(delta > 1LL*dts_error_threshold*AV_TIME_BASE && ist->dec_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE)) {
|
||||
av_log(NULL, AV_LOG_WARNING, "PTS %"PRId64", next:%"PRId64" invalid dropping st:%d\n", pkt.pts, ist->next_dts, pkt.stream_index);
|
||||
pkt.pts = AV_NOPTS_VALUE;
|
||||
}
|
||||
@@ -3856,7 +3752,6 @@ static int transcode(void)
|
||||
av_dict_free(&ost->encoder_opts);
|
||||
av_dict_free(&ost->swr_opts);
|
||||
av_dict_free(&ost->resample_opts);
|
||||
av_dict_free(&ost->bsf_args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3878,7 +3773,7 @@ static int64_t getutime(void)
|
||||
GetProcessTimes(proc, &c, &e, &k, &u);
|
||||
return ((int64_t) u.dwHighDateTime << 32 | u.dwLowDateTime) / 10;
|
||||
#else
|
||||
return av_gettime_relative();
|
||||
return av_gettime();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
5
ffmpeg.h
5
ffmpeg.h
@@ -388,8 +388,6 @@ typedef struct OutputStream {
|
||||
AVCodec *enc;
|
||||
int64_t max_frames;
|
||||
AVFrame *filtered_frame;
|
||||
AVFrame *last_frame;
|
||||
int last_droped;
|
||||
|
||||
/* video only */
|
||||
AVRational frame_rate;
|
||||
@@ -422,7 +420,6 @@ typedef struct OutputStream {
|
||||
AVDictionary *encoder_opts;
|
||||
AVDictionary *swr_opts;
|
||||
AVDictionary *resample_opts;
|
||||
AVDictionary *bsf_args;
|
||||
char *apad;
|
||||
OSTFinished finished; /* no more packets should be written for this stream */
|
||||
int unavailable; /* true if the steram is unavailable (possibly temporarily) */
|
||||
@@ -484,7 +481,6 @@ extern int do_deinterlace;
|
||||
extern int do_hex_dump;
|
||||
extern int do_pkt_dump;
|
||||
extern int copy_ts;
|
||||
extern int start_at_zero;
|
||||
extern int copy_tb;
|
||||
extern int debug_ts;
|
||||
extern int exit_on_error;
|
||||
@@ -494,7 +490,6 @@ extern int stdin_interaction;
|
||||
extern int frame_bits_per_raw_sample;
|
||||
extern AVIOContext *progress_avio;
|
||||
extern float max_error_rate;
|
||||
extern int vdpau_api_ver;
|
||||
|
||||
extern const AVIOInterruptCB int_cb;
|
||||
|
||||
|
@@ -383,8 +383,9 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
|
||||
snprintf(name, sizeof(name), "pixel format for output stream %d:%d",
|
||||
ost->file_index, ost->index);
|
||||
ret = avfilter_graph_create_filter(&filter,
|
||||
avfilter_get_by_name("format"),
|
||||
"format", pix_fmts, NULL, fg->graph);
|
||||
avfilter_get_by_name("format"),
|
||||
"format", pix_fmts, NULL,
|
||||
fg->graph);
|
||||
av_freep(&pix_fmts);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -619,7 +620,6 @@ static int sub2video_prepare(InputStream *ist)
|
||||
ist->sub2video.frame = av_frame_alloc();
|
||||
if (!ist->sub2video.frame)
|
||||
return AVERROR(ENOMEM);
|
||||
ist->sub2video.last_pts = INT64_MIN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -637,7 +637,6 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
AVBPrint args;
|
||||
char name[255];
|
||||
int ret, pad_idx = 0;
|
||||
int64_t tsoffset = 0;
|
||||
|
||||
if (ist->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot connect video filter to audio input\n");
|
||||
@@ -712,14 +711,8 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
|
||||
snprintf(name, sizeof(name), "trim for input stream %d:%d",
|
||||
ist->file_index, ist->st->index);
|
||||
if (copy_ts) {
|
||||
tsoffset = f->start_time == AV_NOPTS_VALUE ? 0 : f->start_time;
|
||||
if (!start_at_zero && f->ctx->start_time != AV_NOPTS_VALUE)
|
||||
tsoffset += f->ctx->start_time;
|
||||
}
|
||||
ret = insert_trim(((f->start_time == AV_NOPTS_VALUE) || !f->accurate_seek) ?
|
||||
AV_NOPTS_VALUE : tsoffset, f->recording_time,
|
||||
&last_filter, &pad_idx, name);
|
||||
AV_NOPTS_VALUE : 0, f->recording_time, &last_filter, &pad_idx, name);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@@ -738,7 +731,6 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
AVBPrint args;
|
||||
char name[255];
|
||||
int ret, pad_idx = 0;
|
||||
int64_t tsoffset = 0;
|
||||
|
||||
if (ist->dec_ctx->codec_type != AVMEDIA_TYPE_AUDIO) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot connect audio filter to non audio input\n");
|
||||
@@ -821,14 +813,8 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||
|
||||
snprintf(name, sizeof(name), "trim for input stream %d:%d",
|
||||
ist->file_index, ist->st->index);
|
||||
if (copy_ts) {
|
||||
tsoffset = f->start_time == AV_NOPTS_VALUE ? 0 : f->start_time;
|
||||
if (!start_at_zero && f->ctx->start_time != AV_NOPTS_VALUE)
|
||||
tsoffset += f->ctx->start_time;
|
||||
}
|
||||
ret = insert_trim(((f->start_time == AV_NOPTS_VALUE) || !f->accurate_seek) ?
|
||||
AV_NOPTS_VALUE : tsoffset, f->recording_time,
|
||||
&last_filter, &pad_idx, name);
|
||||
AV_NOPTS_VALUE : 0, f->recording_time, &last_filter, &pad_idx, name);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
90
ffmpeg_opt.c
90
ffmpeg_opt.c
@@ -91,7 +91,6 @@ int do_benchmark_all = 0;
|
||||
int do_hex_dump = 0;
|
||||
int do_pkt_dump = 0;
|
||||
int copy_ts = 0;
|
||||
int start_at_zero = 0;
|
||||
int copy_tb = -1;
|
||||
int debug_ts = 0;
|
||||
int exit_on_error = 0;
|
||||
@@ -509,8 +508,7 @@ static int opt_recording_timestamp(void *optctx, const char *opt, const char *ar
|
||||
char buf[128];
|
||||
int64_t recording_timestamp = parse_time_or_die(opt, arg, 0) / 1E6;
|
||||
struct tm time = *gmtime((time_t*)&recording_timestamp);
|
||||
if (!strftime(buf, sizeof(buf), "creation_time=%FT%T%z", &time))
|
||||
return -1;
|
||||
strftime(buf, sizeof(buf), "creation_time=%FT%T%z", &time);
|
||||
parse_option(o, "metadata", buf, options);
|
||||
|
||||
av_log(NULL, AV_LOG_WARNING, "%s is deprecated, set the 'creation_time' metadata "
|
||||
@@ -704,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);
|
||||
}
|
||||
@@ -794,7 +792,6 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
char * video_codec_name = NULL;
|
||||
char * audio_codec_name = NULL;
|
||||
char *subtitle_codec_name = NULL;
|
||||
int scan_all_pmts_set = 0;
|
||||
|
||||
if (o->format) {
|
||||
if (!(file_iformat = av_find_input_format(o->format))) {
|
||||
@@ -865,18 +862,12 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
ic->flags |= AVFMT_FLAG_NONBLOCK;
|
||||
ic->interrupt_callback = int_cb;
|
||||
|
||||
if (!av_dict_get(o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) {
|
||||
av_dict_set(&o->g->format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
|
||||
scan_all_pmts_set = 1;
|
||||
}
|
||||
/* open the input file with generic avformat function */
|
||||
err = avformat_open_input(&ic, filename, file_iformat, &o->g->format_opts);
|
||||
if (err < 0) {
|
||||
print_error(filename, err);
|
||||
exit_program(1);
|
||||
}
|
||||
if (scan_all_pmts_set)
|
||||
av_dict_set(&o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
|
||||
remove_avoptions(&o->g->format_opts, o->g->codec_opts);
|
||||
assert_avoptions(o->g->format_opts);
|
||||
|
||||
@@ -930,7 +921,7 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
||||
f->start_time = o->start_time;
|
||||
f->recording_time = o->recording_time;
|
||||
f->input_ts_offset = o->input_ts_offset;
|
||||
f->ts_offset = o->input_ts_offset - (copy_ts ? (start_at_zero && ic->start_time != AV_NOPTS_VALUE ? ic->start_time : 0) : timestamp);
|
||||
f->ts_offset = o->input_ts_offset - (copy_ts ? 0 : timestamp);
|
||||
f->nb_streams = ic->nb_streams;
|
||||
f->rate_emu = o->rate_emu;
|
||||
f->accurate_seek = o->accurate_seek;
|
||||
@@ -1138,11 +1129,8 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
|
||||
MATCH_PER_STREAM_OPT(bitstream_filters, str, bsf, oc, st);
|
||||
while (bsf) {
|
||||
char *arg = NULL;
|
||||
if (next = strchr(bsf, ','))
|
||||
*next++ = 0;
|
||||
if (arg = strchr(bsf, '='))
|
||||
*arg++ = 0;
|
||||
if (!(bsfc = av_bitstream_filter_init(bsf))) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Unknown bitstream filter %s\n", bsf);
|
||||
exit_program(1);
|
||||
@@ -1151,7 +1139,6 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
|
||||
bsfc_prev->next = bsfc;
|
||||
else
|
||||
ost->bitstream_filters = bsfc;
|
||||
av_dict_set(&ost->bsf_args, bsfc->filter->name, arg, 0);
|
||||
|
||||
bsfc_prev = bsfc;
|
||||
bsf = next;
|
||||
@@ -1289,8 +1276,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
av_log(NULL, AV_LOG_FATAL, "Invalid framerate value: %s\n", frame_rate);
|
||||
exit_program(1);
|
||||
}
|
||||
if (frame_rate && video_sync_method == VSYNC_PASSTHROUGH)
|
||||
av_log(NULL, AV_LOG_ERROR, "Using -vsync 0 and -r can produce invalid output files\n");
|
||||
|
||||
MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st);
|
||||
if (frame_aspect_ratio) {
|
||||
@@ -1635,36 +1620,27 @@ static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const ch
|
||||
AVStream *st;
|
||||
OutputStream *ost;
|
||||
AVCodec *codec;
|
||||
const char *enc_config;
|
||||
AVCodecContext *avctx;
|
||||
|
||||
codec = avcodec_find_encoder(ic->streams[i]->codec->codec_id);
|
||||
if (!codec) {
|
||||
av_log(s, AV_LOG_ERROR, "no encoder found for codec id %i\n", ic->streams[i]->codec->codec_id);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (codec->type == AVMEDIA_TYPE_AUDIO)
|
||||
opt_audio_codec(o, "c:a", codec->name);
|
||||
else if (codec->type == AVMEDIA_TYPE_VIDEO)
|
||||
opt_video_codec(o, "c:v", codec->name);
|
||||
ost = new_output_stream(o, s, codec->type, -1);
|
||||
st = ost->st;
|
||||
avctx = st->codec;
|
||||
ost->enc = codec;
|
||||
|
||||
avcodec_get_context_defaults3(st->codec, codec);
|
||||
enc_config = av_stream_get_recommended_encoder_configuration(ic->streams[i]);
|
||||
if (enc_config) {
|
||||
AVDictionary *opts = NULL;
|
||||
av_dict_parse_string(&opts, enc_config, "=", ",", 0);
|
||||
av_opt_set_dict2(st->codec, &opts, AV_OPT_SEARCH_CHILDREN);
|
||||
av_dict_free(&opts);
|
||||
}
|
||||
// FIXME: a more elegant solution is needed
|
||||
memcpy(st, ic->streams[i], sizeof(AVStream));
|
||||
st->cur_dts = 0;
|
||||
st->info = av_malloc(sizeof(*st->info));
|
||||
memcpy(st->info, ic->streams[i]->info, sizeof(*st->info));
|
||||
st->codec= avctx;
|
||||
avcodec_copy_context(st->codec, ic->streams[i]->codec);
|
||||
|
||||
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && !ost->stream_copy)
|
||||
choose_sample_fmt(st, codec);
|
||||
else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && !ost->stream_copy)
|
||||
choose_pixel_fmt(st, st->codec, codec, st->codec->pix_fmt);
|
||||
avcodec_copy_context(ost->enc_ctx, st->codec);
|
||||
if (enc_config)
|
||||
av_dict_parse_string(&ost->encoder_opts, enc_config, "=", ",", 0);
|
||||
}
|
||||
|
||||
avformat_close_input(&ic);
|
||||
@@ -1752,8 +1728,8 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
if (o->stop_time != INT64_MAX && o->recording_time == INT64_MAX) {
|
||||
int64_t start_time = o->start_time == AV_NOPTS_VALUE ? 0 : o->start_time;
|
||||
if (o->stop_time <= start_time) {
|
||||
av_log(NULL, AV_LOG_ERROR, "-to value smaller than -ss; aborting.\n");
|
||||
exit_program(1);
|
||||
av_log(NULL, AV_LOG_WARNING, "-to value smaller than -ss; ignoring -to.\n");
|
||||
o->stop_time = INT64_MAX;
|
||||
} else {
|
||||
o->recording_time = o->stop_time - start_time;
|
||||
}
|
||||
@@ -2248,9 +2224,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
opt_default(NULL, "g", norm == PAL ? "15" : "18");
|
||||
|
||||
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;
|
||||
opt_default(NULL, "maxrate", "1150000");
|
||||
opt_default(NULL, "minrate", "1150000");
|
||||
opt_default(NULL, "bufsize", "327680"); // 40*1024*8;
|
||||
|
||||
opt_default(NULL, "b:a", "224000");
|
||||
parse_option(o, "ar", "44100", options);
|
||||
@@ -2277,9 +2253,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
opt_default(NULL, "g", norm == PAL ? "15" : "18");
|
||||
|
||||
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, "maxrate", "2516000");
|
||||
opt_default(NULL, "minrate", "0"); // 1145000;
|
||||
opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
|
||||
opt_default(NULL, "scan_offset", "1");
|
||||
|
||||
opt_default(NULL, "b:a", "224000");
|
||||
@@ -2299,9 +2275,9 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
|
||||
opt_default(NULL, "g", norm == PAL ? "15" : "18");
|
||||
|
||||
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;
|
||||
opt_default(NULL, "maxrate", "9000000");
|
||||
opt_default(NULL, "minrate", "0"); // 1500000;
|
||||
opt_default(NULL, "bufsize", "1835008"); // 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
|
||||
@@ -2345,9 +2321,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);
|
||||
@@ -2828,13 +2801,13 @@ 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" },
|
||||
{ "dframes", HAS_ARG | OPT_PERFILE | OPT_EXPERT |
|
||||
OPT_OUTPUT, { .func_arg = opt_data_frames },
|
||||
"set the number of data frames to output", "number" },
|
||||
"set the number of data frames to record", "number" },
|
||||
{ "benchmark", OPT_BOOL | OPT_EXPERT, { &do_benchmark },
|
||||
"add timings for benchmarking" },
|
||||
{ "benchmark_all", OPT_BOOL | OPT_EXPERT, { &do_benchmark_all },
|
||||
@@ -2863,8 +2836,6 @@ const OptionDef options[] = {
|
||||
"audio drift threshold", "threshold" },
|
||||
{ "copyts", OPT_BOOL | OPT_EXPERT, { ©_ts },
|
||||
"copy timestamps" },
|
||||
{ "start_at_zero", OPT_BOOL | OPT_EXPERT, { &start_at_zero },
|
||||
"shift input timestamps to start at 0 when using copyts" },
|
||||
{ "copytb", HAS_ARG | OPT_INT | OPT_EXPERT, { ©_tb },
|
||||
"copy input stream time base when stream copying", "mode" },
|
||||
{ "shortest", OPT_BOOL | OPT_EXPERT | OPT_OFFSET |
|
||||
@@ -2885,7 +2856,7 @@ const OptionDef options[] = {
|
||||
{ "copypriorss", OPT_INT | HAS_ARG | OPT_EXPERT | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(copy_prior_start) },
|
||||
"copy or discard frames before start time" },
|
||||
{ "frames", OPT_INT64 | HAS_ARG | OPT_SPEC | OPT_OUTPUT, { .off = OFFSET(max_frames) },
|
||||
"set the number of frames to output", "number" },
|
||||
"set the number of frames to record", "number" },
|
||||
{ "tag", OPT_STRING | HAS_ARG | OPT_SPEC |
|
||||
OPT_EXPERT | OPT_OUTPUT | OPT_INPUT, { .off = OFFSET(codec_tags) },
|
||||
"force codec tag/fourcc", "fourcc/tag" },
|
||||
@@ -2927,7 +2898,7 @@ const OptionDef options[] = {
|
||||
|
||||
/* video options */
|
||||
{ "vframes", OPT_VIDEO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_video_frames },
|
||||
"set the number of video frames to output", "number" },
|
||||
"set the number of video frames to record", "number" },
|
||||
{ "r", OPT_VIDEO | HAS_ARG | OPT_STRING | OPT_SPEC |
|
||||
OPT_INPUT | OPT_OUTPUT, { .off = OFFSET(frame_rates) },
|
||||
"set frame rate (Hz value, fraction or abbreviation)", "rate" },
|
||||
@@ -3009,13 +2980,10 @@ const OptionDef options[] = {
|
||||
{ "hwaccel_device", OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
|
||||
OPT_SPEC | OPT_INPUT, { .off = OFFSET(hwaccel_devices) },
|
||||
"select a device for HW acceleration" "devicename" },
|
||||
#if HAVE_VDPAU_X11
|
||||
{ "vdpau_api_ver", HAS_ARG | OPT_INT | OPT_EXPERT, { &vdpau_api_ver }, "" },
|
||||
#endif
|
||||
|
||||
/* audio options */
|
||||
{ "aframes", OPT_AUDIO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_audio_frames },
|
||||
"set the number of audio frames to output", "number" },
|
||||
"set the number of audio frames to record", "number" },
|
||||
{ "aq", OPT_AUDIO | HAS_ARG | OPT_PERFILE | OPT_OUTPUT, { .func_arg = opt_audio_qscale },
|
||||
"set audio quality (codec-specific)", "quality", },
|
||||
{ "ar", OPT_AUDIO | HAS_ARG | OPT_INT | OPT_SPEC |
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -42,11 +42,9 @@ typedef struct VDPAUContext {
|
||||
VdpGetErrorString *get_error_string;
|
||||
VdpGetInformationString *get_information_string;
|
||||
VdpDeviceDestroy *device_destroy;
|
||||
#if 1 // for ffmpegs older vdpau API, not the oldest though
|
||||
VdpDecoderCreate *decoder_create;
|
||||
VdpDecoderDestroy *decoder_destroy;
|
||||
VdpDecoderRender *decoder_render;
|
||||
#endif
|
||||
VdpVideoSurfaceCreate *video_surface_create;
|
||||
VdpVideoSurfaceDestroy *video_surface_destroy;
|
||||
VdpVideoSurfaceGetBitsYCbCr *video_surface_get_bits;
|
||||
@@ -59,8 +57,6 @@ typedef struct VDPAUContext {
|
||||
VdpYCbCrFormat vdpau_format;
|
||||
} VDPAUContext;
|
||||
|
||||
int vdpau_api_ver = 2;
|
||||
|
||||
static void vdpau_uninit(AVCodecContext *s)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
@@ -243,11 +239,9 @@ do {
|
||||
GET_CALLBACK(VDP_FUNC_ID_GET_ERROR_STRING, get_error_string);
|
||||
GET_CALLBACK(VDP_FUNC_ID_GET_INFORMATION_STRING, get_information_string);
|
||||
GET_CALLBACK(VDP_FUNC_ID_DEVICE_DESTROY, device_destroy);
|
||||
if (vdpau_api_ver == 1) {
|
||||
GET_CALLBACK(VDP_FUNC_ID_DECODER_CREATE, decoder_create);
|
||||
GET_CALLBACK(VDP_FUNC_ID_DECODER_DESTROY, decoder_destroy);
|
||||
GET_CALLBACK(VDP_FUNC_ID_DECODER_RENDER, decoder_render);
|
||||
}
|
||||
GET_CALLBACK(VDP_FUNC_ID_DECODER_CREATE, decoder_create);
|
||||
GET_CALLBACK(VDP_FUNC_ID_DECODER_DESTROY, decoder_destroy);
|
||||
GET_CALLBACK(VDP_FUNC_ID_DECODER_RENDER, decoder_render);
|
||||
GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_CREATE, video_surface_create);
|
||||
GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_DESTROY, video_surface_destroy);
|
||||
GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR, video_surface_get_bits);
|
||||
@@ -276,16 +270,12 @@ do {
|
||||
ctx->vdpau_format = vdpau_formats[i][0];
|
||||
ctx->pix_fmt = vdpau_formats[i][1];
|
||||
|
||||
if (vdpau_api_ver == 1) {
|
||||
vdpau_ctx = av_vdpau_alloc_context();
|
||||
if (!vdpau_ctx)
|
||||
goto fail;
|
||||
vdpau_ctx->render = ctx->decoder_render;
|
||||
|
||||
s->hwaccel_context = vdpau_ctx;
|
||||
} else
|
||||
if (av_vdpau_bind_context(s, ctx->device, ctx->get_proc_address, 0))
|
||||
vdpau_ctx = av_vdpau_alloc_context();
|
||||
if (!vdpau_ctx)
|
||||
goto fail;
|
||||
vdpau_ctx->render = ctx->decoder_render;
|
||||
|
||||
s->hwaccel_context = vdpau_ctx;
|
||||
|
||||
ctx->get_information_string(&vendor);
|
||||
av_log(NULL, AV_LOG_VERBOSE, "Using VDPAU -- %s -- on X11 display %s, "
|
||||
@@ -301,7 +291,7 @@ fail:
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
static int vdpau_old_init(AVCodecContext *s)
|
||||
int vdpau_init(AVCodecContext *s)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
|
||||
@@ -343,22 +333,3 @@ static int vdpau_old_init(AVCodecContext *s)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vdpau_init(AVCodecContext *s)
|
||||
{
|
||||
InputStream *ist = s->opaque;
|
||||
|
||||
if (vdpau_api_ver == 1)
|
||||
return vdpau_old_init(s);
|
||||
|
||||
if (!ist->hwaccel_ctx) {
|
||||
int ret = vdpau_alloc(s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ist->hwaccel_get_buffer = vdpau_get_buffer;
|
||||
ist->hwaccel_retrieve_data = vdpau_retrieve_data;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
102
ffprobe.c
102
ffprobe.c
@@ -66,9 +66,6 @@ static int do_show_stream_disposition = 0;
|
||||
static int do_show_data = 0;
|
||||
static int do_show_program_version = 0;
|
||||
static int do_show_library_versions = 0;
|
||||
static int do_show_pixel_formats = 0;
|
||||
static int do_show_pixel_format_flags = 0;
|
||||
static int do_show_pixel_format_components = 0;
|
||||
|
||||
static int do_show_chapter_tags = 0;
|
||||
static int do_show_format_tags = 0;
|
||||
@@ -135,11 +132,6 @@ typedef enum {
|
||||
SECTION_ID_PACKET,
|
||||
SECTION_ID_PACKETS,
|
||||
SECTION_ID_PACKETS_AND_FRAMES,
|
||||
SECTION_ID_PIXEL_FORMAT,
|
||||
SECTION_ID_PIXEL_FORMAT_FLAGS,
|
||||
SECTION_ID_PIXEL_FORMAT_COMPONENT,
|
||||
SECTION_ID_PIXEL_FORMAT_COMPONENTS,
|
||||
SECTION_ID_PIXEL_FORMATS,
|
||||
SECTION_ID_PROGRAM_STREAM_DISPOSITION,
|
||||
SECTION_ID_PROGRAM_STREAM_TAGS,
|
||||
SECTION_ID_PROGRAM,
|
||||
@@ -173,11 +165,6 @@ static struct section sections[] = {
|
||||
[SECTION_ID_PACKETS] = { SECTION_ID_PACKETS, "packets", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} },
|
||||
[SECTION_ID_PACKETS_AND_FRAMES] = { SECTION_ID_PACKETS_AND_FRAMES, "packets_and_frames", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} },
|
||||
[SECTION_ID_PACKET] = { SECTION_ID_PACKET, "packet", 0, { -1 } },
|
||||
[SECTION_ID_PIXEL_FORMATS] = { SECTION_ID_PIXEL_FORMATS, "pixel_formats", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PIXEL_FORMAT, -1 } },
|
||||
[SECTION_ID_PIXEL_FORMAT] = { SECTION_ID_PIXEL_FORMAT, "pixel_format", 0, { SECTION_ID_PIXEL_FORMAT_FLAGS, SECTION_ID_PIXEL_FORMAT_COMPONENTS, -1 } },
|
||||
[SECTION_ID_PIXEL_FORMAT_FLAGS] = { SECTION_ID_PIXEL_FORMAT_FLAGS, "flags", 0, { -1 }, .unique_name = "pixel_format_flags" },
|
||||
[SECTION_ID_PIXEL_FORMAT_COMPONENTS] = { SECTION_ID_PIXEL_FORMAT_COMPONENTS, "components", SECTION_FLAG_IS_ARRAY, {SECTION_ID_PIXEL_FORMAT_COMPONENT, -1 }, .unique_name = "pixel_format_components" },
|
||||
[SECTION_ID_PIXEL_FORMAT_COMPONENT] = { SECTION_ID_PIXEL_FORMAT_COMPONENT, "component", 0, { -1 } },
|
||||
[SECTION_ID_PROGRAM_STREAM_DISPOSITION] = { SECTION_ID_PROGRAM_STREAM_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "program_stream_disposition" },
|
||||
[SECTION_ID_PROGRAM_STREAM_TAGS] = { SECTION_ID_PROGRAM_STREAM_TAGS, "tags", SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = "tag", .unique_name = "program_stream_tags" },
|
||||
[SECTION_ID_PROGRAM] = { SECTION_ID_PROGRAM, "program", 0, { SECTION_ID_PROGRAM_TAGS, SECTION_ID_PROGRAM_STREAMS, -1 } },
|
||||
@@ -188,8 +175,7 @@ static struct section sections[] = {
|
||||
[SECTION_ID_PROGRAMS] = { SECTION_ID_PROGRAMS, "programs", SECTION_FLAG_IS_ARRAY, { SECTION_ID_PROGRAM, -1 } },
|
||||
[SECTION_ID_ROOT] = { SECTION_ID_ROOT, "root", SECTION_FLAG_IS_WRAPPER,
|
||||
{ SECTION_ID_CHAPTERS, SECTION_ID_FORMAT, SECTION_ID_FRAMES, SECTION_ID_PROGRAMS, SECTION_ID_STREAMS,
|
||||
SECTION_ID_PACKETS, SECTION_ID_ERROR, SECTION_ID_PROGRAM_VERSION, SECTION_ID_LIBRARY_VERSIONS,
|
||||
SECTION_ID_PIXEL_FORMATS, -1} },
|
||||
SECTION_ID_PACKETS, SECTION_ID_ERROR, SECTION_ID_PROGRAM_VERSION, SECTION_ID_LIBRARY_VERSIONS, -1} },
|
||||
[SECTION_ID_STREAMS] = { SECTION_ID_STREAMS, "streams", SECTION_FLAG_IS_ARRAY, { SECTION_ID_STREAM, -1 } },
|
||||
[SECTION_ID_STREAM] = { SECTION_ID_STREAM, "stream", 0, { SECTION_ID_STREAM_DISPOSITION, SECTION_ID_STREAM_TAGS, -1 } },
|
||||
[SECTION_ID_STREAM_DISPOSITION] = { SECTION_ID_STREAM_DISPOSITION, "disposition", 0, { -1 }, .unique_name = "stream_disposition" },
|
||||
@@ -2112,28 +2098,12 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
|
||||
else print_str_opt("pix_fmt", "unknown");
|
||||
print_int("level", dec_ctx->level);
|
||||
if (dec_ctx->color_range != AVCOL_RANGE_UNSPECIFIED)
|
||||
print_str ("color_range", av_color_range_name(dec_ctx->color_range));
|
||||
print_str ("color_range", dec_ctx->color_range == AVCOL_RANGE_MPEG ? "tv": "pc");
|
||||
else
|
||||
print_str_opt("color_range", "N/A");
|
||||
s = av_get_colorspace_name(dec_ctx->colorspace);
|
||||
if (s) print_str ("color_space", s);
|
||||
else print_str_opt("color_space", "unknown");
|
||||
|
||||
if (dec_ctx->color_trc != AVCOL_TRC_UNSPECIFIED)
|
||||
print_str("color_transfer", av_color_transfer_name(dec_ctx->color_trc));
|
||||
else
|
||||
print_str_opt("color_transfer", av_color_transfer_name(dec_ctx->color_trc));
|
||||
|
||||
if (dec_ctx->color_primaries != AVCOL_PRI_UNSPECIFIED)
|
||||
print_str("color_primaries", av_color_primaries_name(dec_ctx->color_primaries));
|
||||
else
|
||||
print_str_opt("color_primaries", av_color_primaries_name(dec_ctx->color_primaries));
|
||||
|
||||
if (dec_ctx->chroma_sample_location != AVCHROMA_LOC_UNSPECIFIED)
|
||||
print_str("chroma_location", av_chroma_location_name(dec_ctx->chroma_sample_location));
|
||||
else
|
||||
print_str_opt("chroma_location", av_chroma_location_name(dec_ctx->chroma_sample_location));
|
||||
|
||||
if (dec_ctx->timecode_frame_start >= 0) {
|
||||
char tcbuf[AV_TIMECODE_STR_SIZE];
|
||||
av_timecode_make_mpeg_tc_string(tcbuf, dec_ctx->timecode_frame_start);
|
||||
@@ -2386,19 +2356,12 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
|
||||
AVFormatContext *fmt_ctx = NULL;
|
||||
AVDictionaryEntry *t;
|
||||
AVDictionary **opts;
|
||||
int scan_all_pmts_set = 0;
|
||||
|
||||
if (!av_dict_get(format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) {
|
||||
av_dict_set(&format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
|
||||
scan_all_pmts_set = 1;
|
||||
}
|
||||
if ((err = avformat_open_input(&fmt_ctx, filename,
|
||||
iformat, &format_opts)) < 0) {
|
||||
print_error(filename, err);
|
||||
return err;
|
||||
}
|
||||
if (scan_all_pmts_set)
|
||||
av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
|
||||
if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
|
||||
return AVERROR_OPTION_NOT_FOUND;
|
||||
@@ -2594,58 +2557,6 @@ static void ffprobe_show_library_versions(WriterContext *w)
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
|
||||
#define PRINT_PIX_FMT_FLAG(flagname, name) \
|
||||
do { \
|
||||
print_int(name, !!(pixdesc->flags & AV_PIX_FMT_FLAG_##flagname)); \
|
||||
} while (0)
|
||||
|
||||
static void ffprobe_show_pixel_formats(WriterContext *w)
|
||||
{
|
||||
const AVPixFmtDescriptor *pixdesc = NULL;
|
||||
int i, n;
|
||||
|
||||
writer_print_section_header(w, SECTION_ID_PIXEL_FORMATS);
|
||||
while (pixdesc = av_pix_fmt_desc_next(pixdesc)) {
|
||||
writer_print_section_header(w, SECTION_ID_PIXEL_FORMAT);
|
||||
print_str("name", pixdesc->name);
|
||||
print_int("nb_components", pixdesc->nb_components);
|
||||
if ((pixdesc->nb_components >= 3) && !(pixdesc->flags & AV_PIX_FMT_FLAG_RGB)) {
|
||||
print_int ("log2_chroma_w", pixdesc->log2_chroma_w);
|
||||
print_int ("log2_chroma_h", pixdesc->log2_chroma_h);
|
||||
} else {
|
||||
print_str_opt("log2_chroma_w", "N/A");
|
||||
print_str_opt("log2_chroma_h", "N/A");
|
||||
}
|
||||
n = av_get_bits_per_pixel(pixdesc);
|
||||
if (n) print_int ("bits_per_pixel", n);
|
||||
else print_str_opt("bits_per_pixel", "N/A");
|
||||
if (do_show_pixel_format_flags) {
|
||||
writer_print_section_header(w, SECTION_ID_PIXEL_FORMAT_FLAGS);
|
||||
PRINT_PIX_FMT_FLAG(BE, "big_endian");
|
||||
PRINT_PIX_FMT_FLAG(PAL, "palette");
|
||||
PRINT_PIX_FMT_FLAG(BITSTREAM, "bitstream");
|
||||
PRINT_PIX_FMT_FLAG(HWACCEL, "hwaccel");
|
||||
PRINT_PIX_FMT_FLAG(PLANAR, "planar");
|
||||
PRINT_PIX_FMT_FLAG(RGB, "rgb");
|
||||
PRINT_PIX_FMT_FLAG(PSEUDOPAL, "pseudopal");
|
||||
PRINT_PIX_FMT_FLAG(ALPHA, "alpha");
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
if (do_show_pixel_format_components && (pixdesc->nb_components > 0)) {
|
||||
writer_print_section_header(w, SECTION_ID_PIXEL_FORMAT_COMPONENTS);
|
||||
for (i = 0; i < pixdesc->nb_components; i++) {
|
||||
writer_print_section_header(w, SECTION_ID_PIXEL_FORMAT_COMPONENT);
|
||||
print_int("index", i + 1);
|
||||
print_int("bit_depth", pixdesc->comp[i].depth_minus1 + 1);
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
writer_print_section_footer(w);
|
||||
}
|
||||
|
||||
static int opt_format(void *optctx, const char *opt, const char *arg)
|
||||
{
|
||||
iformat = av_find_input_format(arg);
|
||||
@@ -2979,7 +2890,6 @@ DEFINE_OPT_SHOW_SECTION(format, FORMAT);
|
||||
DEFINE_OPT_SHOW_SECTION(frames, FRAMES);
|
||||
DEFINE_OPT_SHOW_SECTION(library_versions, LIBRARY_VERSIONS);
|
||||
DEFINE_OPT_SHOW_SECTION(packets, PACKETS);
|
||||
DEFINE_OPT_SHOW_SECTION(pixel_formats, PIXEL_FORMATS);
|
||||
DEFINE_OPT_SHOW_SECTION(program_version, PROGRAM_VERSION);
|
||||
DEFINE_OPT_SHOW_SECTION(streams, STREAMS);
|
||||
DEFINE_OPT_SHOW_SECTION(programs, PROGRAMS);
|
||||
@@ -3018,7 +2928,6 @@ static const OptionDef real_options[] = {
|
||||
{ "show_program_version", 0, {(void*)&opt_show_program_version}, "show ffprobe version" },
|
||||
{ "show_library_versions", 0, {(void*)&opt_show_library_versions}, "show library versions" },
|
||||
{ "show_versions", 0, {(void*)&opt_show_versions}, "show program and library versions" },
|
||||
{ "show_pixel_formats", 0, {(void*)&opt_show_pixel_formats}, "show pixel format descriptions" },
|
||||
{ "show_private_data", OPT_BOOL, {(void*)&show_private_data}, "show private data" },
|
||||
{ "private", OPT_BOOL, {(void*)&show_private_data}, "same as show_private_data" },
|
||||
{ "bitexact", OPT_BOOL, {&do_bitexact}, "force bitexact output" },
|
||||
@@ -3075,9 +2984,6 @@ int main(int argc, char **argv)
|
||||
SET_DO_SHOW(FRAMES, frames);
|
||||
SET_DO_SHOW(LIBRARY_VERSIONS, library_versions);
|
||||
SET_DO_SHOW(PACKETS, packets);
|
||||
SET_DO_SHOW(PIXEL_FORMATS, pixel_formats);
|
||||
SET_DO_SHOW(PIXEL_FORMAT_FLAGS, pixel_format_flags);
|
||||
SET_DO_SHOW(PIXEL_FORMAT_COMPONENTS, pixel_format_components);
|
||||
SET_DO_SHOW(PROGRAM_VERSION, program_version);
|
||||
SET_DO_SHOW(PROGRAMS, programs);
|
||||
SET_DO_SHOW(STREAMS, streams);
|
||||
@@ -3142,12 +3048,10 @@ int main(int argc, char **argv)
|
||||
ffprobe_show_program_version(wctx);
|
||||
if (do_show_library_versions)
|
||||
ffprobe_show_library_versions(wctx);
|
||||
if (do_show_pixel_formats)
|
||||
ffprobe_show_pixel_formats(wctx);
|
||||
|
||||
if (!input_filename &&
|
||||
((do_show_format || do_show_programs || do_show_streams || do_show_chapters || do_show_packets || do_show_error) ||
|
||||
(!do_show_program_version && !do_show_library_versions && !do_show_pixel_formats))) {
|
||||
(!do_show_program_version && !do_show_library_versions))) {
|
||||
show_usage();
|
||||
av_log(NULL, AV_LOG_ERROR, "You have to specify one input file.\n");
|
||||
av_log(NULL, AV_LOG_ERROR, "Use -h to get full help or, even better, run 'man %s'.\n", program_name);
|
||||
|
1252
ffserver.c
1252
ffserver.c
File diff suppressed because it is too large
Load Diff
1260
ffserver_config.c
1260
ffserver_config.c
File diff suppressed because it is too large
Load Diff
@@ -1,133 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2001, 2002 Fabrice Bellard
|
||||
*
|
||||
* 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 FFSERVER_CONFIG_H
|
||||
#define FFSERVER_CONFIG_H
|
||||
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/network.h"
|
||||
|
||||
#define FFSERVER_MAX_STREAMS 20
|
||||
|
||||
/* each generated stream is described here */
|
||||
enum FFServerStreamType {
|
||||
STREAM_TYPE_LIVE,
|
||||
STREAM_TYPE_STATUS,
|
||||
STREAM_TYPE_REDIRECT,
|
||||
};
|
||||
|
||||
enum FFServerIPAddressAction {
|
||||
IP_ALLOW = 1,
|
||||
IP_DENY,
|
||||
};
|
||||
|
||||
typedef struct FFServerIPAddressACL {
|
||||
struct FFServerIPAddressACL *next;
|
||||
enum FFServerIPAddressAction action;
|
||||
/* These are in host order */
|
||||
struct in_addr first;
|
||||
struct in_addr last;
|
||||
} FFServerIPAddressACL;
|
||||
|
||||
/* description of each stream of the ffserver.conf file */
|
||||
typedef struct FFServerStream {
|
||||
enum FFServerStreamType stream_type;
|
||||
char filename[1024]; /* stream filename */
|
||||
struct FFServerStream *feed; /* feed we are using (can be null if coming from file) */
|
||||
AVDictionary *in_opts; /* input parameters */
|
||||
AVDictionary *metadata; /* metadata to set on the stream */
|
||||
AVInputFormat *ifmt; /* if non NULL, force input format */
|
||||
AVOutputFormat *fmt;
|
||||
FFServerIPAddressACL *acl;
|
||||
char dynamic_acl[1024];
|
||||
int nb_streams;
|
||||
int prebuffer; /* Number of milliseconds early to start */
|
||||
int64_t max_time; /* Number of milliseconds to run */
|
||||
int send_on_key;
|
||||
AVStream *streams[FFSERVER_MAX_STREAMS];
|
||||
int feed_streams[FFSERVER_MAX_STREAMS]; /* index of streams in the feed */
|
||||
char feed_filename[1024]; /* file name of the feed storage, or
|
||||
input file name for a stream */
|
||||
pid_t pid; /* Of ffmpeg process */
|
||||
time_t pid_start; /* Of ffmpeg process */
|
||||
char **child_argv;
|
||||
struct FFServerStream *next;
|
||||
unsigned bandwidth; /* bandwidth, in kbits/s */
|
||||
/* RTSP options */
|
||||
char *rtsp_option;
|
||||
/* multicast specific */
|
||||
int is_multicast;
|
||||
struct in_addr multicast_ip;
|
||||
int multicast_port; /* first port used for multicast */
|
||||
int multicast_ttl;
|
||||
int loop; /* if true, send the stream in loops (only meaningful if file) */
|
||||
|
||||
/* feed specific */
|
||||
int feed_opened; /* true if someone is writing to the feed */
|
||||
int is_feed; /* true if it is a feed */
|
||||
int readonly; /* True if writing is prohibited to the file */
|
||||
int truncate; /* True if feeder connection truncate the feed file */
|
||||
int conns_served;
|
||||
int64_t bytes_served;
|
||||
int64_t feed_max_size; /* maximum storage size, zero means unlimited */
|
||||
int64_t feed_write_index; /* current write position in feed (it wraps around) */
|
||||
int64_t feed_size; /* current size of feed */
|
||||
struct FFServerStream *next_feed;
|
||||
} FFServerStream;
|
||||
|
||||
typedef struct FFServerConfig {
|
||||
char *filename;
|
||||
FFServerStream *first_feed; /* contains only feeds */
|
||||
FFServerStream *first_stream; /* contains all streams, including feeds */
|
||||
unsigned int nb_max_http_connections;
|
||||
unsigned int nb_max_connections;
|
||||
uint64_t max_bandwidth;
|
||||
int debug;
|
||||
char logfilename[1024];
|
||||
struct sockaddr_in http_addr;
|
||||
struct sockaddr_in rtsp_addr;
|
||||
int errors;
|
||||
int warnings;
|
||||
int use_defaults;
|
||||
// Following variables MUST NOT be used outside configuration parsing code.
|
||||
enum AVCodecID guessed_audio_codec_id;
|
||||
enum AVCodecID guessed_video_codec_id;
|
||||
AVDictionary *video_opts; /* AVOptions for video encoder */
|
||||
AVDictionary *audio_opts; /* AVOptions for audio encoder */
|
||||
AVCodecContext *dummy_actx; /* Used internally to test audio AVOptions. */
|
||||
AVCodecContext *dummy_vctx; /* Used internally to test video AVOptions. */
|
||||
int no_audio;
|
||||
int no_video;
|
||||
int line_num;
|
||||
int stream_use_defaults;
|
||||
} FFServerConfig;
|
||||
|
||||
void ffserver_get_arg(char *buf, int buf_size, const char **pp);
|
||||
|
||||
void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
|
||||
FFServerIPAddressACL *ext_acl,
|
||||
const char *p, const char *filename, int line_num);
|
||||
|
||||
int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config);
|
||||
|
||||
void ffserver_free_child_args(void *argsp);
|
||||
|
||||
#endif /* FFSERVER_CONFIG_H */
|
@@ -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;
|
||||
|
@@ -339,25 +339,21 @@ static inline void mcdc(uint16_t *dst, const uint16_t *src, int log2w,
|
||||
}
|
||||
}
|
||||
|
||||
static int decode_p_block(FourXContext *f, uint16_t *dst, const uint16_t *src,
|
||||
static int decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src,
|
||||
int log2w, int log2h, int stride)
|
||||
{
|
||||
int index, h, code, ret, scale = 1;
|
||||
uint16_t *start, *end;
|
||||
const int index = size2index[log2h][log2w];
|
||||
const int h = 1 << log2h;
|
||||
int code = get_vlc2(&f->gb,
|
||||
block_type_vlc[1 - (f->version > 1)][index].table,
|
||||
BLOCK_TYPE_VLC_BITS, 1);
|
||||
uint16_t *start = f->last_frame_buffer;
|
||||
uint16_t *end = start + stride * (f->avctx->height - h + 1) - (1 << log2w);
|
||||
int ret;
|
||||
int scale = 1;
|
||||
unsigned dc = 0;
|
||||
|
||||
av_assert0(log2w >= 0 && log2h >= 0);
|
||||
|
||||
index = size2index[log2h][log2w];
|
||||
av_assert0(index >= 0);
|
||||
|
||||
h = 1 << log2h;
|
||||
code = get_vlc2(&f->gb, block_type_vlc[1 - (f->version > 1)][index].table,
|
||||
BLOCK_TYPE_VLC_BITS, 1);
|
||||
av_assert0(code >= 0 && code <= 6);
|
||||
|
||||
start = f->last_frame_buffer;
|
||||
end = start + stride * (f->avctx->height - h + 1) - (1 << log2w);
|
||||
av_assert0(code >= 0 && code <= 6 && log2w >= 0);
|
||||
|
||||
if (code == 1) {
|
||||
log2h--;
|
||||
|
@@ -11,7 +11,6 @@ HEADERS = avcodec.h \
|
||||
vda.h \
|
||||
vdpau.h \
|
||||
version.h \
|
||||
vorbis_parser.h \
|
||||
xvmc.h \
|
||||
|
||||
OBJS = allcodecs.o \
|
||||
@@ -32,8 +31,6 @@ OBJS = allcodecs.o \
|
||||
resample.o \
|
||||
resample2.o \
|
||||
utils.o \
|
||||
vorbis_parser.o \
|
||||
xiph.o \
|
||||
|
||||
# subsystems
|
||||
OBJS-$(CONFIG_AANDCTTABLES) += aandcttab.o
|
||||
@@ -73,7 +70,7 @@ 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
|
||||
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
|
||||
@@ -136,7 +133,6 @@ OBJS-$(CONFIG_AMV_ENCODER) += mjpegenc.o mjpeg.o mjpegenc_common.o \
|
||||
OBJS-$(CONFIG_ANM_DECODER) += anm.o
|
||||
OBJS-$(CONFIG_ANSI_DECODER) += ansi.o cga_data.o
|
||||
OBJS-$(CONFIG_APE_DECODER) += apedec.o
|
||||
OBJS-$(CONFIG_APNG_DECODER) += png.o pngdec.o pngdsp.o
|
||||
OBJS-$(CONFIG_SSA_DECODER) += assdec.o ass.o ass_split.o
|
||||
OBJS-$(CONFIG_SSA_ENCODER) += assenc.o ass.o
|
||||
OBJS-$(CONFIG_ASS_DECODER) += assdec.o ass.o ass_split.o
|
||||
@@ -210,7 +206,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 \
|
||||
@@ -280,7 +276,7 @@ OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
|
||||
OBJS-$(CONFIG_JACOSUB_DECODER) += jacosubdec.o ass.o
|
||||
OBJS-$(CONFIG_JPEG2000_ENCODER) += j2kenc.o mqcenc.o mqc.o jpeg2000.o \
|
||||
jpeg2000dwt.o
|
||||
OBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dec.o jpeg2000.o jpeg2000dsp.o \
|
||||
OBJS-$(CONFIG_JPEG2000_DECODER) += jpeg2000dec.o jpeg2000.o \
|
||||
jpeg2000dwt.o mqcdec.o mqc.o
|
||||
OBJS-$(CONFIG_JPEGLS_DECODER) += jpeglsdec.o jpegls.o
|
||||
OBJS-$(CONFIG_JPEGLS_ENCODER) += jpeglsenc.o jpegls.o
|
||||
@@ -433,7 +429,6 @@ OBJS-$(CONFIG_SONIC_LS_ENCODER) += sonic.o
|
||||
OBJS-$(CONFIG_SP5X_DECODER) += sp5xdec.o
|
||||
OBJS-$(CONFIG_SRT_DECODER) += srtdec.o ass.o
|
||||
OBJS-$(CONFIG_SRT_ENCODER) += srtenc.o ass_split.o
|
||||
OBJS-$(CONFIG_STL_DECODER) += textdec.o ass.o
|
||||
OBJS-$(CONFIG_SUBRIP_DECODER) += srtdec.o ass.o
|
||||
OBJS-$(CONFIG_SUBRIP_ENCODER) += srtenc.o ass_split.o
|
||||
OBJS-$(CONFIG_SUBVIEWER1_DECODER) += textdec.o ass.o
|
||||
@@ -449,6 +444,7 @@ OBJS-$(CONFIG_TAK_DECODER) += takdec.o tak.o
|
||||
OBJS-$(CONFIG_TARGA_DECODER) += targa.o
|
||||
OBJS-$(CONFIG_TARGA_ENCODER) += targaenc.o rle.o
|
||||
OBJS-$(CONFIG_TARGA_Y216_DECODER) += targa_y216dec.o
|
||||
OBJS-$(CONFIG_THEORA_DECODER) += xiph.o
|
||||
OBJS-$(CONFIG_TIERTEXSEQVIDEO_DECODER) += tiertexseqv.o
|
||||
OBJS-$(CONFIG_TIFF_DECODER) += tiff.o lzw.o faxcompr.o tiff_data.o tiff_common.o
|
||||
OBJS-$(CONFIG_TIFF_ENCODER) += tiffenc.o rle.o lzwenc.o tiff_data.o
|
||||
@@ -477,9 +473,7 @@ OBJS-$(CONFIG_V410_ENCODER) += v410enc.o
|
||||
OBJS-$(CONFIG_V210X_DECODER) += v210x.o
|
||||
OBJS-$(CONFIG_VB_DECODER) += vb.o
|
||||
OBJS-$(CONFIG_VBLE_DECODER) += vble.o
|
||||
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1_block.o vc1_loopfilter.o \
|
||||
vc1_mc.o vc1_pred.o vc1.o vc1data.o \
|
||||
vc1dsp.o \
|
||||
OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o \
|
||||
msmpeg4dec.o msmpeg4.o msmpeg4data.o \
|
||||
wmv2dsp.o
|
||||
OBJS-$(CONFIG_VCR1_DECODER) += vcr1.o
|
||||
@@ -487,7 +481,7 @@ OBJS-$(CONFIG_VMDAUDIO_DECODER) += vmdaudio.o
|
||||
OBJS-$(CONFIG_VMDVIDEO_DECODER) += vmdvideo.o
|
||||
OBJS-$(CONFIG_VMNC_DECODER) += vmnc.o
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += vorbisdec.o vorbisdsp.o vorbis.o \
|
||||
vorbis_data.o
|
||||
vorbis_data.o xiph.o
|
||||
OBJS-$(CONFIG_VORBIS_ENCODER) += vorbisenc.o vorbis.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_VP3_DECODER) += vp3.o
|
||||
@@ -679,18 +673,20 @@ OBJS-$(CONFIG_VC1_VDPAU_HWACCEL) += vdpau_vc1.o
|
||||
OBJS-$(CONFIG_ADTS_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_CAF_DEMUXER) += mpeg4audio.o mpegaudiodata.o \
|
||||
ac3tab.o
|
||||
OBJS-$(CONFIG_FLAC_DEMUXER) += flac.o flacdata.o vorbis_data.o
|
||||
OBJS-$(CONFIG_FLAC_DEMUXER) += flac.o flacdata.o vorbis_data.o \
|
||||
vorbis_parser.o xiph.o
|
||||
OBJS-$(CONFIG_FLAC_MUXER) += flac.o flacdata.o vorbis_data.o
|
||||
OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_GXF_DEMUXER) += mpeg12data.o
|
||||
OBJS-$(CONFIG_IFF_DEMUXER) += iff.o
|
||||
OBJS-$(CONFIG_ISMV_MUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_LATM_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += mpeg4audio.o vorbis_data.o \
|
||||
OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += xiph.o mpeg4audio.o vorbis_data.o \
|
||||
flac.o flacdata.o
|
||||
OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o \
|
||||
vorbis_parser.o xiph.o
|
||||
OBJS-$(CONFIG_MATROSKA_MUXER) += mpeg4audio.o mpegaudiodata.o \
|
||||
flac.o flacdata.o vorbis_data.o
|
||||
flac.o flacdata.o vorbis_data.o xiph.o
|
||||
OBJS-$(CONFIG_MP2_MUXER) += mpegaudiodata.o mpegaudiodecheader.o
|
||||
OBJS-$(CONFIG_MP3_MUXER) += mpegaudiodata.o mpegaudiodecheader.o
|
||||
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o ac3tab.o
|
||||
@@ -699,19 +695,21 @@ OBJS-$(CONFIG_MPEGTS_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_MPEGTS_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
OBJS-$(CONFIG_MXF_MUXER) += dnxhddata.o
|
||||
OBJS-$(CONFIG_NUT_MUXER) += mpegaudiodata.o
|
||||
OBJS-$(CONFIG_OGA_MUXER) += flac.o flacdata.o
|
||||
OBJS-$(CONFIG_OGG_DEMUXER) += mpeg12data.o \
|
||||
OBJS-$(CONFIG_OGA_MUXER) += xiph.o flac.o flacdata.o
|
||||
OBJS-$(CONFIG_OGG_DEMUXER) += xiph.o flac.o flacdata.o \
|
||||
mpeg12data.o vorbis_parser.o \
|
||||
dirac.o vorbis_data.o
|
||||
OBJS-$(CONFIG_OGG_MUXER) += flac.o flacdata.o \
|
||||
OBJS-$(CONFIG_OGG_MUXER) += xiph.o flac.o flacdata.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_RTP_MUXER) += mpeg4audio.o
|
||||
OBJS-$(CONFIG_RTP_MUXER) += mpeg4audio.o xiph.o
|
||||
OBJS-$(CONFIG_RTPDEC) += mjpeg.o
|
||||
OBJS-$(CONFIG_SPDIF_DEMUXER) += aacadtsdec.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_SPDIF_MUXER) += dca.o
|
||||
OBJS-$(CONFIG_TAK_DEMUXER) += tak.o
|
||||
OBJS-$(CONFIG_WEBM_MUXER) += mpeg4audio.o mpegaudiodata.o \
|
||||
flac.o flacdata.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
|
||||
@@ -755,7 +753,7 @@ OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \
|
||||
vorbis_data.o
|
||||
vorbis_data.o vorbis_parser.o xiph.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP8_DECODER) += libvpxdec.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP8_ENCODER) += libvpxenc.o
|
||||
OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o libvpx.o
|
||||
@@ -811,6 +809,7 @@ 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
|
||||
OBJS-$(CONFIG_VORBIS_PARSER) += vorbis_parser.o xiph.o
|
||||
OBJS-$(CONFIG_VP3_PARSER) += vp3_parser.o
|
||||
OBJS-$(CONFIG_VP8_PARSER) += vp8_parser.o
|
||||
OBJS-$(CONFIG_VP9_PARSER) += vp9_parser.o
|
||||
|
@@ -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,6 +186,7 @@ static void render_charset(AVCodecContext *avctx, uint8_t *charset,
|
||||
static av_cold int a64multi_close_encoder(AVCodecContext *avctx)
|
||||
{
|
||||
A64Context *c = avctx->priv_data;
|
||||
av_frame_free(&avctx->coded_frame);
|
||||
av_freep(&c->mc_meta_charset);
|
||||
av_freep(&c->mc_best_cb);
|
||||
av_freep(&c->mc_charset);
|
||||
@@ -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,6 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
|
||||
/* advance pointers */
|
||||
buf += charset_size;
|
||||
req_size += charset_size;
|
||||
}
|
||||
|
||||
/* write x frames to buf */
|
||||
@@ -380,7 +387,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;
|
||||
|
@@ -245,7 +245,6 @@ typedef struct SingleChannelElement {
|
||||
* channel element - generic struct for SCE/CPE/CCE/LFE
|
||||
*/
|
||||
typedef struct ChannelElement {
|
||||
int present;
|
||||
// CPE specific
|
||||
int common_window; ///< Set if channels share a common 'IndividualChannelStream' in bitstream.
|
||||
int ms_mode; ///< Signals mid/side stereo flags coding mode (used by encoder)
|
||||
@@ -275,7 +274,6 @@ struct AACContext {
|
||||
ChannelElement *che[4][MAX_ELEM_ID];
|
||||
ChannelElement *tag_che_map[4][MAX_ELEM_ID];
|
||||
int tags_mapped;
|
||||
int warned_remapping_once;
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
@@ -295,7 +293,7 @@ struct AACContext {
|
||||
FFTContext mdct_ld;
|
||||
FFTContext mdct_ltp;
|
||||
FmtConvertContext fmt_conv;
|
||||
AVFloatDSPContext *fdsp;
|
||||
AVFloatDSPContext fdsp;
|
||||
int random_state;
|
||||
/** @} */
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
@@ -621,12 +621,6 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
|
||||
* If we seem to have encountered such a stream, transfer
|
||||
* the LFE[0] element to the SCE[1]'s mapping */
|
||||
if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
|
||||
if (!ac->warned_remapping_once && (type != TYPE_LFE || elem_id != 0)) {
|
||||
av_log(ac->avctx, AV_LOG_WARNING,
|
||||
"This stream seems to incorrectly report its last channel as %s[%d], mapping to LFE[0]\n",
|
||||
type == TYPE_SCE ? "SCE" : "LFE", elem_id);
|
||||
ac->warned_remapping_once++;
|
||||
}
|
||||
ac->tags_mapped++;
|
||||
return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0];
|
||||
}
|
||||
@@ -636,22 +630,6 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
|
||||
return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][1];
|
||||
}
|
||||
case 4:
|
||||
/* Some streams incorrectly code 4.0 audio as
|
||||
* SCE[0] CPE[0] LFE[0]
|
||||
* instead of
|
||||
* SCE[0] CPE[0] SCE[1].
|
||||
* If we seem to have encountered such a stream, transfer
|
||||
* the SCE[1] element to the LFE[0]'s mapping */
|
||||
if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
|
||||
if (!ac->warned_remapping_once && (type != TYPE_SCE || elem_id != 1)) {
|
||||
av_log(ac->avctx, AV_LOG_WARNING,
|
||||
"This stream seems to incorrectly report its last channel as %s[%d], mapping to SCE[1]\n",
|
||||
type == TYPE_SCE ? "SCE" : "LFE", elem_id);
|
||||
ac->warned_remapping_once++;
|
||||
}
|
||||
ac->tags_mapped++;
|
||||
return ac->tag_che_map[type][elem_id] = ac->che[TYPE_SCE][1];
|
||||
}
|
||||
if (ac->tags_mapped == 2 &&
|
||||
ac->oc[1].m4ac.chan_config == 4 &&
|
||||
type == TYPE_SCE) {
|
||||
@@ -703,7 +681,6 @@ static void decode_channel_map(uint8_t layout_map[][3],
|
||||
syn_ele = TYPE_LFE;
|
||||
break;
|
||||
default:
|
||||
// AAC_CHANNEL_OFF has no channel map
|
||||
av_assert0(0);
|
||||
}
|
||||
layout_map[0][0] = syn_ele;
|
||||
@@ -904,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);
|
||||
@@ -1137,10 +1114,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
||||
ff_aac_sbr_init();
|
||||
|
||||
ff_fmt_convert_init(&ac->fmt_conv, avctx);
|
||||
ac->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
if (!ac->fdsp) {
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
avpriv_float_dsp_init(&ac->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
|
||||
ac->random_state = 0x1f2e3d4c;
|
||||
|
||||
@@ -1516,12 +1490,13 @@ static void decode_mid_side_stereo(ChannelElement *cpe, GetBitContext *gb,
|
||||
int ms_present)
|
||||
{
|
||||
int idx;
|
||||
int max_idx = cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb;
|
||||
if (ms_present == 1) {
|
||||
for (idx = 0; idx < max_idx; idx++)
|
||||
for (idx = 0;
|
||||
idx < cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb;
|
||||
idx++)
|
||||
cpe->ms_mask[idx] = get_bits1(gb);
|
||||
} else if (ms_present == 2) {
|
||||
memset(cpe->ms_mask, 1, max_idx * sizeof(cpe->ms_mask[0]));
|
||||
memset(cpe->ms_mask, 1, sizeof(cpe->ms_mask[0]) * cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1643,9 +1618,9 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
||||
cfo[k] = ac->random_state;
|
||||
}
|
||||
|
||||
band_energy = ac->fdsp->scalarproduct_float(cfo, cfo, off_len);
|
||||
band_energy = ac->fdsp.scalarproduct_float(cfo, cfo, off_len);
|
||||
scale = sf[idx] / sqrtf(band_energy);
|
||||
ac->fdsp->vector_fmul_scalar(cfo, cfo, scale, off_len);
|
||||
ac->fdsp.vector_fmul_scalar(cfo, cfo, scale, off_len);
|
||||
}
|
||||
} else {
|
||||
const float *vq = ff_aac_codebook_vector_vals[cbt_m1];
|
||||
@@ -1791,7 +1766,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
|
||||
}
|
||||
} while (len -= 2);
|
||||
|
||||
ac->fdsp->vector_fmul_scalar(cfo, cfo, sf[idx], off_len);
|
||||
ac->fdsp.vector_fmul_scalar(cfo, cfo, sf[idx], off_len);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2004,7 +1979,7 @@ static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe)
|
||||
cpe->ch[0].band_type[idx] < NOISE_BT &&
|
||||
cpe->ch[1].band_type[idx] < NOISE_BT) {
|
||||
for (group = 0; group < ics->group_len[g]; group++) {
|
||||
ac->fdsp->butterflies_float(ch0 + group * 128 + offsets[i],
|
||||
ac->fdsp.butterflies_float(ch0 + group * 128 + offsets[i],
|
||||
ch1 + group * 128 + offsets[i],
|
||||
offsets[i+1] - offsets[i]);
|
||||
}
|
||||
@@ -2043,7 +2018,7 @@ static void apply_intensity_stereo(AACContext *ac,
|
||||
c *= 1 - 2 * cpe->ms_mask[idx];
|
||||
scale = c * sce1->sf[idx];
|
||||
for (group = 0; group < ics->group_len[g]; group++)
|
||||
ac->fdsp->vector_fmul_scalar(coef1 + group * 128 + offsets[i],
|
||||
ac->fdsp.vector_fmul_scalar(coef1 + group * 128 + offsets[i],
|
||||
coef0 + group * 128 + offsets[i],
|
||||
scale,
|
||||
offsets[i + 1] - offsets[i]);
|
||||
@@ -2293,12 +2268,7 @@ static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
|
||||
{
|
||||
int crc_flag = 0;
|
||||
int res = cnt;
|
||||
int type = get_bits(gb, 4);
|
||||
|
||||
if (ac->avctx->debug & FF_DEBUG_STARTCODE)
|
||||
av_log(ac->avctx, AV_LOG_DEBUG, "extension type: %d len:%d\n", type, cnt);
|
||||
|
||||
switch (type) { // extension type
|
||||
switch (get_bits(gb, 4)) { // extension type
|
||||
case EXT_SBR_DATA_CRC:
|
||||
crc_flag++;
|
||||
case EXT_SBR_DATA:
|
||||
@@ -2411,15 +2381,15 @@ static void windowing_and_mdct_ltp(AACContext *ac, float *out,
|
||||
const float *swindow_prev = ics->use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
|
||||
|
||||
if (ics->window_sequence[0] != LONG_STOP_SEQUENCE) {
|
||||
ac->fdsp->vector_fmul(in, in, lwindow_prev, 1024);
|
||||
ac->fdsp.vector_fmul(in, in, lwindow_prev, 1024);
|
||||
} else {
|
||||
memset(in, 0, 448 * sizeof(float));
|
||||
ac->fdsp->vector_fmul(in + 448, in + 448, swindow_prev, 128);
|
||||
ac->fdsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);
|
||||
}
|
||||
if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
|
||||
ac->fdsp->vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
|
||||
ac->fdsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
|
||||
} else {
|
||||
ac->fdsp->vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
|
||||
ac->fdsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
|
||||
memset(in + 1024 + 576, 0, 448 * sizeof(float));
|
||||
}
|
||||
ac->mdct_ltp.mdct_calc(&ac->mdct_ltp, out, in);
|
||||
@@ -2472,17 +2442,17 @@ static void update_ltp(AACContext *ac, SingleChannelElement *sce)
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
memcpy(saved_ltp, saved, 512 * sizeof(float));
|
||||
memset(saved_ltp + 576, 0, 448 * sizeof(float));
|
||||
ac->fdsp->vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
ac->fdsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
for (i = 0; i < 64; i++)
|
||||
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
|
||||
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
|
||||
memcpy(saved_ltp, ac->buf_mdct + 512, 448 * sizeof(float));
|
||||
memset(saved_ltp + 576, 0, 448 * sizeof(float));
|
||||
ac->fdsp->vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
ac->fdsp.vector_fmul_reverse(saved_ltp + 448, ac->buf_mdct + 960, &swindow[64], 64);
|
||||
for (i = 0; i < 64; i++)
|
||||
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * swindow[63 - i];
|
||||
} else { // LONG_STOP or ONLY_LONG
|
||||
ac->fdsp->vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
|
||||
ac->fdsp.vector_fmul_reverse(saved_ltp, ac->buf_mdct + 512, &lwindow[512], 512);
|
||||
for (i = 0; i < 512; i++)
|
||||
saved_ltp[i + 512] = ac->buf_mdct[1023 - i] * lwindow[511 - i];
|
||||
}
|
||||
@@ -2523,19 +2493,19 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
|
||||
*/
|
||||
if ((ics->window_sequence[1] == ONLY_LONG_SEQUENCE || ics->window_sequence[1] == LONG_STOP_SEQUENCE) &&
|
||||
(ics->window_sequence[0] == ONLY_LONG_SEQUENCE || ics->window_sequence[0] == LONG_START_SEQUENCE)) {
|
||||
ac->fdsp->vector_fmul_window( out, saved, buf, lwindow_prev, 512);
|
||||
ac->fdsp.vector_fmul_window( out, saved, buf, lwindow_prev, 512);
|
||||
} else {
|
||||
memcpy( out, saved, 448 * sizeof(float));
|
||||
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
ac->fdsp->vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
|
||||
ac->fdsp->vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
|
||||
ac->fdsp->vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
|
||||
ac->fdsp->vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
|
||||
ac->fdsp->vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 0*128, saved + 448, buf + 0*128, swindow_prev, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 1*128, buf + 0*128 + 64, buf + 1*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 2*128, buf + 1*128 + 64, buf + 2*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448 + 3*128, buf + 2*128 + 64, buf + 3*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(temp, buf + 3*128 + 64, buf + 4*128, swindow, 64);
|
||||
memcpy( out + 448 + 4*128, temp, 64 * sizeof(float));
|
||||
} else {
|
||||
ac->fdsp->vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 448, saved + 448, buf, swindow_prev, 64);
|
||||
memcpy( out + 576, buf + 64, 448 * sizeof(float));
|
||||
}
|
||||
}
|
||||
@@ -2543,9 +2513,9 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce)
|
||||
// buffer update
|
||||
if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
|
||||
memcpy( saved, temp + 64, 64 * sizeof(float));
|
||||
ac->fdsp->vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
|
||||
ac->fdsp->vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
|
||||
ac->fdsp->vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(saved + 64, buf + 4*128 + 64, buf + 5*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(saved + 192, buf + 5*128 + 64, buf + 6*128, swindow, 64);
|
||||
ac->fdsp.vector_fmul_window(saved + 320, buf + 6*128 + 64, buf + 7*128, swindow, 64);
|
||||
memcpy( saved + 448, buf + 7*128 + 64, 64 * sizeof(float));
|
||||
} else if (ics->window_sequence[0] == LONG_START_SEQUENCE) {
|
||||
memcpy( saved, buf + 512, 448 * sizeof(float));
|
||||
@@ -2570,10 +2540,10 @@ static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce)
|
||||
if (ics->use_kb_window[1]) {
|
||||
// AAC LD uses a low overlap sine window instead of a KBD window
|
||||
memcpy(out, saved, 192 * sizeof(float));
|
||||
ac->fdsp->vector_fmul_window(out + 192, saved + 192, buf, ff_sine_128, 64);
|
||||
ac->fdsp.vector_fmul_window(out + 192, saved + 192, buf, ff_sine_128, 64);
|
||||
memcpy( out + 320, buf + 64, 192 * sizeof(float));
|
||||
} else {
|
||||
ac->fdsp->vector_fmul_window(out, saved, buf, ff_sine_512, 256);
|
||||
ac->fdsp.vector_fmul_window(out, saved, buf, ff_sine_512, 256);
|
||||
}
|
||||
|
||||
// buffer update
|
||||
@@ -2746,7 +2716,7 @@ static void spectral_to_sample(AACContext *ac)
|
||||
for (type = 3; type >= 0; type--) {
|
||||
for (i = 0; i < MAX_ELEM_ID; i++) {
|
||||
ChannelElement *che = ac->che[type][i];
|
||||
if (che && che->present) {
|
||||
if (che) {
|
||||
if (type <= TYPE_CPE)
|
||||
apply_channel_coupling(ac, che, type, i, BEFORE_TNS, apply_dependent_coupling);
|
||||
if (ac->oc[1].m4ac.object_type == AOT_AAC_LTP) {
|
||||
@@ -2778,9 +2748,6 @@ static void spectral_to_sample(AACContext *ac)
|
||||
}
|
||||
if (type <= TYPE_CCE)
|
||||
apply_channel_coupling(ac, che, type, i, AFTER_IMDCT, apply_independent_coupling);
|
||||
che->present = 0;
|
||||
} else if (che) {
|
||||
av_log(ac->avctx, AV_LOG_VERBOSE, "ChannelElement %d.%d missing \n", type, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2885,7 +2852,6 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
|
||||
elem_type, elem_id);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
che->present = 1;
|
||||
if (aot != AOT_ER_AAC_ELD)
|
||||
skip_bits(gb, 4);
|
||||
switch (elem_type) {
|
||||
@@ -2949,9 +2915,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
while ((elem_type = get_bits(gb, 3)) != TYPE_END) {
|
||||
elem_id = get_bits(gb, 4);
|
||||
|
||||
if (avctx->debug & FF_DEBUG_STARTCODE)
|
||||
av_log(avctx, AV_LOG_DEBUG, "Elem type:%x id:%x\n", elem_type, elem_id);
|
||||
|
||||
if (elem_type < TYPE_DSE) {
|
||||
if (!(che=get_che(ac, elem_type, elem_id))) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n",
|
||||
@@ -2960,7 +2923,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
|
||||
goto fail;
|
||||
}
|
||||
samples = 1024;
|
||||
che->present = 1;
|
||||
}
|
||||
|
||||
switch (elem_type) {
|
||||
@@ -3059,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;
|
||||
@@ -3134,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) {
|
||||
@@ -3175,7 +3131,6 @@ static av_cold int aac_decode_close(AVCodecContext *avctx)
|
||||
ff_mdct_end(&ac->mdct_small);
|
||||
ff_mdct_end(&ac->mdct_ld);
|
||||
ff_mdct_end(&ac->mdct_ltp);
|
||||
av_freep(&ac->fdsp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3485,18 +3440,6 @@ static const AVClass aac_decoder_class = {
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
|
||||
static const AVProfile profiles[] = {
|
||||
{ FF_PROFILE_AAC_MAIN, "Main" },
|
||||
{ FF_PROFILE_AAC_LOW, "LC" },
|
||||
{ FF_PROFILE_AAC_SSR, "SSR" },
|
||||
{ FF_PROFILE_AAC_LTP, "LTP" },
|
||||
{ FF_PROFILE_AAC_HE, "HE-AAC" },
|
||||
{ FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
|
||||
{ FF_PROFILE_AAC_LD, "LD" },
|
||||
{ FF_PROFILE_AAC_ELD, "ELD" },
|
||||
{ FF_PROFILE_UNKNOWN },
|
||||
};
|
||||
|
||||
AVCodec ff_aac_decoder = {
|
||||
.name = "aac",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
|
||||
@@ -3513,7 +3456,6 @@ AVCodec ff_aac_decoder = {
|
||||
.channel_layouts = aac_channel_layout,
|
||||
.flush = flush,
|
||||
.priv_class = &aac_decoder_class,
|
||||
.profiles = profiles,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -3536,5 +3478,4 @@ AVCodec ff_aac_latm_decoder = {
|
||||
.capabilities = CODEC_CAP_CHANNEL_CONF | CODEC_CAP_DR1,
|
||||
.channel_layouts = aac_channel_layout,
|
||||
.flush = flush,
|
||||
.profiles = profiles,
|
||||
};
|
||||
|
@@ -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);
|
||||
@@ -252,7 +252,7 @@ static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce,
|
||||
int i;
|
||||
float *output = sce->ret_buf;
|
||||
|
||||
apply_window[sce->ics.window_sequence[0]](s->fdsp, sce, audio);
|
||||
apply_window[sce->ics.window_sequence[0]](&s->fdsp, sce, audio);
|
||||
|
||||
if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE)
|
||||
s->mdct1024.mdct_calc(&s->mdct1024, sce->coeffs, output);
|
||||
@@ -567,18 +567,6 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
ics->group_len[w] = wi[ch].grouping[w];
|
||||
|
||||
apply_window_and_mdct(s, &cpe->ch[ch], overlap);
|
||||
|
||||
if (isnan(cpe->ch[ch].coeffs[ 0]) || isinf(cpe->ch[ch].coeffs[ 0]) ||
|
||||
isnan(cpe->ch[ch].coeffs[ 128]) || isinf(cpe->ch[ch].coeffs[ 128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[2*128]) || isinf(cpe->ch[ch].coeffs[2*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[3*128]) || isinf(cpe->ch[ch].coeffs[3*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[4*128]) || isinf(cpe->ch[ch].coeffs[4*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[5*128]) || isinf(cpe->ch[ch].coeffs[5*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[6*128]) || isinf(cpe->ch[ch].coeffs[6*128]) ||
|
||||
isnan(cpe->ch[ch].coeffs[7*128]) || isinf(cpe->ch[ch].coeffs[7*128])) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains NaN/+-Inf\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
start_ch += chans;
|
||||
}
|
||||
@@ -690,7 +678,6 @@ static av_cold int aac_encode_end(AVCodecContext *avctx)
|
||||
ff_psy_preprocess_end(s->psypp);
|
||||
av_freep(&s->buffer.samples);
|
||||
av_freep(&s->cpe);
|
||||
av_freep(&s->fdsp);
|
||||
ff_af_queue_close(&s->afq);
|
||||
return 0;
|
||||
}
|
||||
@@ -699,9 +686,7 @@ static av_cold int dsp_init(AVCodecContext *avctx, AACEncContext *s)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
if (!s->fdsp)
|
||||
return AVERROR(ENOMEM);
|
||||
avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
|
||||
// window init
|
||||
ff_kbd_window_init(ff_aac_kbd_long_1024, 4.0, 1024);
|
||||
@@ -761,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;
|
||||
@@ -776,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];
|
||||
@@ -792,7 +776,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
for (i = 0; i < 428; i++)
|
||||
ff_aac_pow34sf_tab[i] = sqrt(ff_aac_pow2sf_tab[i] * sqrt(ff_aac_pow2sf_tab[i]));
|
||||
|
||||
avctx->initial_padding = 1024;
|
||||
avctx->delay = 1024;
|
||||
ff_af_queue_init(avctx, &s->afq);
|
||||
|
||||
return 0;
|
||||
|
@@ -67,7 +67,7 @@ typedef struct AACEncContext {
|
||||
PutBitContext pb;
|
||||
FFTContext mdct1024; ///< long (1024 samples) frame transform context
|
||||
FFTContext mdct128; ///< short (128 samples) frame transform context
|
||||
AVFloatDSPContext *fdsp;
|
||||
AVFloatDSPContext fdsp;
|
||||
float *planar_samples[6]; ///< saved preprocessed input
|
||||
|
||||
int samplerate_index; ///< MPEG-4 samplerate index
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -326,7 +326,7 @@ static int check_n_master(AVCodecContext *avctx, int n_master, int bs_xover_band
|
||||
static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
|
||||
SpectrumParameters *spectrum)
|
||||
{
|
||||
unsigned int temp, max_qmf_subbands = 0;
|
||||
unsigned int temp, max_qmf_subbands;
|
||||
unsigned int start_min, stop_min;
|
||||
int k;
|
||||
const int8_t *sbr_offset_ptr;
|
||||
@@ -514,7 +514,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 +528,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 +556,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 +1011,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);
|
||||
@@ -1620,14 +1611,8 @@ static void sbr_hf_assemble(float Y1[38][64][2],
|
||||
memcpy(q_temp[i + 2*ch_data->t_env[0]], sbr->q_m[0], m_max * sizeof(sbr->q_m[0][0]));
|
||||
}
|
||||
} else if (h_SL) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
memcpy(g_temp[i + 2 * ch_data->t_env[0]],
|
||||
g_temp[i + 2 * ch_data->t_env_num_env_old],
|
||||
sizeof(g_temp[0]));
|
||||
memcpy(q_temp[i + 2 * ch_data->t_env[0]],
|
||||
q_temp[i + 2 * ch_data->t_env_num_env_old],
|
||||
sizeof(q_temp[0]));
|
||||
}
|
||||
memcpy(g_temp[2*ch_data->t_env[0]], g_temp[2*ch_data->t_env_num_env_old], 4*sizeof(g_temp[0]));
|
||||
memcpy(q_temp[2*ch_data->t_env[0]], q_temp[2*ch_data->t_env_num_env_old], 4*sizeof(q_temp[0]));
|
||||
}
|
||||
|
||||
for (e = 0; e < ch_data->bs_num_env; e++) {
|
||||
@@ -1696,12 +1681,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];
|
||||
@@ -1714,7 +1693,7 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
}
|
||||
for (ch = 0; ch < nch; ch++) {
|
||||
/* decode channel */
|
||||
sbr_qmf_analysis(ac->fdsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
|
||||
sbr_qmf_analysis(&ac->fdsp, &sbr->mdct_ana, &sbr->dsp, ch ? R : L, sbr->data[ch].analysis_filterbank_samples,
|
||||
(float*)sbr->qmf_filter_scratch,
|
||||
sbr->data[ch].W, sbr->data[ch].Ypos);
|
||||
sbr->c.sbr_lf_gen(ac, sbr, sbr->X_low,
|
||||
@@ -1725,7 +1704,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,
|
||||
@@ -1761,13 +1739,13 @@ void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac,
|
||||
nch = 2;
|
||||
}
|
||||
|
||||
sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, ac->fdsp,
|
||||
sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, &ac->fdsp,
|
||||
L, sbr->X[0], sbr->qmf_filter_scratch,
|
||||
sbr->data[0].synthesis_filterbank_samples,
|
||||
&sbr->data[0].synthesis_filterbank_samples_offset,
|
||||
downsampled);
|
||||
if (nch == 2)
|
||||
sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, ac->fdsp,
|
||||
sbr_qmf_synthesis(&sbr->mdct, &sbr->dsp, &ac->fdsp,
|
||||
R, sbr->X[1], sbr->qmf_filter_scratch,
|
||||
sbr->data[1].synthesis_filterbank_samples,
|
||||
&sbr->data[1].synthesis_filterbank_samples_offset,
|
||||
|
@@ -376,8 +376,7 @@ function ff_fft_calc_neon, export=1
|
||||
ld1 {v30.16b}, [x10]
|
||||
mov x7, #-8
|
||||
movrel x12, pmmp
|
||||
ldr x4, [x3, x2, lsl #3]
|
||||
add x3, x3, x4
|
||||
ldr x3, [x3, x2, lsl #3]
|
||||
movrel x13, mppm
|
||||
movrel x14, X(ff_cos_16)
|
||||
ld1 {v31.16b}, [x11]
|
||||
@@ -417,21 +416,21 @@ function ff_fft_permute_neon, export=1
|
||||
endfunc
|
||||
|
||||
const fft_tab_neon
|
||||
.quad fft4_neon - fft_tab_neon
|
||||
.quad fft8_neon - fft_tab_neon
|
||||
.quad fft16_neon - fft_tab_neon
|
||||
.quad fft32_neon - fft_tab_neon
|
||||
.quad fft64_neon - fft_tab_neon
|
||||
.quad fft128_neon - fft_tab_neon
|
||||
.quad fft256_neon - fft_tab_neon
|
||||
.quad fft512_neon - fft_tab_neon
|
||||
.quad fft1024_neon - fft_tab_neon
|
||||
.quad fft2048_neon - fft_tab_neon
|
||||
.quad fft4096_neon - fft_tab_neon
|
||||
.quad fft8192_neon - fft_tab_neon
|
||||
.quad fft16384_neon - fft_tab_neon
|
||||
.quad fft32768_neon - fft_tab_neon
|
||||
.quad fft65536_neon - fft_tab_neon
|
||||
.quad fft4_neon
|
||||
.quad fft8_neon
|
||||
.quad fft16_neon
|
||||
.quad fft32_neon
|
||||
.quad fft64_neon
|
||||
.quad fft128_neon
|
||||
.quad fft256_neon
|
||||
.quad fft512_neon
|
||||
.quad fft1024_neon
|
||||
.quad fft2048_neon
|
||||
.quad fft4096_neon
|
||||
.quad fft8192_neon
|
||||
.quad fft16384_neon
|
||||
.quad fft32768_neon
|
||||
.quad fft65536_neon
|
||||
endconst
|
||||
|
||||
const pmmp, align=4
|
||||
|
@@ -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;
|
||||
|
@@ -438,8 +438,8 @@ function fft_b15_calc_neon
|
||||
uzp1 v12.4s, v4.4s, v5.4s // exp[11 - 14].re
|
||||
uzp2 v13.4s, v4.4s, v5.4s // exp[11 - 14].im
|
||||
zip1 v14.4s, v6.4s, v7.4s // exp[5,10].re/exp[5,10].im
|
||||
ldr x6, [x5, x3, lsl #3]
|
||||
add x5, x5, x6
|
||||
add x5, x5, x3, lsl #3
|
||||
ldr x5, [x5]
|
||||
mov x10, x0
|
||||
blr x5
|
||||
ldp x20, x30, [sp]
|
||||
@@ -452,13 +452,13 @@ function fft_b15_calc_neon
|
||||
endfunc
|
||||
|
||||
const fft_tab_neon
|
||||
.quad fft15_neon - fft_tab_neon
|
||||
.quad fft30_neon - fft_tab_neon
|
||||
.quad fft60_neon - fft_tab_neon
|
||||
.quad fft120_neon - fft_tab_neon
|
||||
.quad fft240_neon - fft_tab_neon
|
||||
.quad fft480_neon - fft_tab_neon
|
||||
.quad fft960_neon - fft_tab_neon
|
||||
.quad fft15_neon
|
||||
.quad fft30_neon
|
||||
.quad fft60_neon
|
||||
.quad fft120_neon
|
||||
.quad fft240_neon
|
||||
.quad fft480_neon
|
||||
.quad fft960_neon
|
||||
endconst
|
||||
|
||||
function ff_celt_imdct_half_neon, export=1
|
||||
|
@@ -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;
|
||||
|
@@ -195,7 +195,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
|
||||
#if (USE_FIXED)
|
||||
s->fdsp = avpriv_alloc_fixed_dsp(avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
#else
|
||||
s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
#endif
|
||||
|
||||
ff_ac3dsp_init(&s->ac3dsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
@@ -688,7 +688,7 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
|
||||
s->fdsp->vector_fmul_window_scaled(s->outptr[ch - 1], s->delay[ch - 1],
|
||||
s->tmp_output, s->window, 128, 8);
|
||||
#else
|
||||
s->fdsp->vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
|
||||
s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
|
||||
s->tmp_output, s->window, 128);
|
||||
#endif
|
||||
for (i = 0; i < 128; i++)
|
||||
@@ -700,7 +700,7 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
|
||||
s->fdsp->vector_fmul_window_scaled(s->outptr[ch - 1], s->delay[ch - 1],
|
||||
s->tmp_output, s->window, 128, 8);
|
||||
#else
|
||||
s->fdsp->vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
|
||||
s->fdsp.vector_fmul_window(s->outptr[ch - 1], s->delay[ch - 1],
|
||||
s->tmp_output, s->window, 128);
|
||||
#endif
|
||||
memcpy(s->delay[ch - 1], s->tmp_output + 128, 128 * sizeof(FFTSample));
|
||||
@@ -872,7 +872,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;
|
||||
@@ -902,13 +902,11 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
ff_eac3_default_spx_band_struct,
|
||||
&s->num_spx_bands,
|
||||
s->spx_band_sizes);
|
||||
}
|
||||
}
|
||||
if (!s->eac3 || !s->spx_in_use) {
|
||||
s->spx_in_use = 0;
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
s->channel_uses_spx[ch] = 0;
|
||||
s->first_spx_coords[ch] = 1;
|
||||
} else {
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
s->channel_uses_spx[ch] = 0;
|
||||
s->first_spx_coords[ch] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -941,7 +939,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);
|
||||
@@ -1637,7 +1635,9 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx)
|
||||
AC3DecodeContext *s = avctx->priv_data;
|
||||
ff_mdct_end(&s->imdct_512);
|
||||
ff_mdct_end(&s->imdct_256);
|
||||
#if (USE_FIXED)
|
||||
av_freep(&s->fdsp);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -218,7 +218,7 @@ typedef struct AC3DecodeContext {
|
||||
#if USE_FIXED
|
||||
AVFixedDSPContext *fdsp;
|
||||
#else
|
||||
AVFloatDSPContext *fdsp;
|
||||
AVFloatDSPContext fdsp;
|
||||
#endif
|
||||
AC3DSPContext ac3dsp;
|
||||
FmtConvertContext fmt_conv; ///< optimized conversion functions
|
||||
@@ -243,19 +243,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 */
|
||||
|
@@ -164,7 +164,6 @@ static void ac3_downmix_c_fixed16(int16_t **samples, int16_t (*matrix)[2],
|
||||
}
|
||||
}
|
||||
|
||||
#include "eac3dec.c"
|
||||
#include "ac3dec.c"
|
||||
|
||||
static const AVOption options[] = {
|
||||
|
@@ -28,7 +28,6 @@
|
||||
* Upmix delay samples from stereo to original channel layout.
|
||||
*/
|
||||
#include "ac3dec.h"
|
||||
#include "eac3dec.c"
|
||||
#include "ac3dec.c"
|
||||
|
||||
static const AVOption options[] = {
|
||||
|
@@ -2035,7 +2035,6 @@ av_cold int ff_ac3_encode_close(AVCodecContext *avctx)
|
||||
av_freep(&s->qmant_buffer);
|
||||
av_freep(&s->cpl_coord_exp_buffer);
|
||||
av_freep(&s->cpl_coord_mant_buffer);
|
||||
av_freep(&s->fdsp);
|
||||
for (blk = 0; blk < s->num_blocks; blk++) {
|
||||
AC3Block *block = &s->blocks[blk];
|
||||
av_freep(&block->mdct_coef);
|
||||
@@ -2435,7 +2434,7 @@ av_cold int ff_ac3_encode_init(AVCodecContext *avctx)
|
||||
return ret;
|
||||
|
||||
avctx->frame_size = AC3_BLOCK_SIZE * s->num_blocks;
|
||||
avctx->initial_padding = AC3_BLOCK_SIZE;
|
||||
avctx->delay = AC3_BLOCK_SIZE;
|
||||
|
||||
s->bitstream_mode = avctx->audio_service_type;
|
||||
if (s->bitstream_mode == AV_AUDIO_SERVICE_TYPE_KARAOKE)
|
||||
|
@@ -80,14 +80,12 @@ typedef int64_t CoefSumType;
|
||||
#define AC3ENC_OPT_NOT_INDICATED 0
|
||||
#define AC3ENC_OPT_MODE_ON 2
|
||||
#define AC3ENC_OPT_MODE_OFF 1
|
||||
#define AC3ENC_OPT_DSUREX_DPLIIZ 3
|
||||
|
||||
/* specific option values */
|
||||
#define AC3ENC_OPT_LARGE_ROOM 1
|
||||
#define AC3ENC_OPT_SMALL_ROOM 2
|
||||
#define AC3ENC_OPT_DOWNMIX_LTRT 1
|
||||
#define AC3ENC_OPT_DOWNMIX_LORO 2
|
||||
#define AC3ENC_OPT_DOWNMIX_DPLII 3 // reserved value in A/52, but used by encoders to indicate DPL2
|
||||
#define AC3ENC_OPT_ADCONV_STANDARD 0
|
||||
#define AC3ENC_OPT_ADCONV_HDCD 1
|
||||
|
||||
@@ -165,7 +163,7 @@ typedef struct AC3EncodeContext {
|
||||
AVCodecContext *avctx; ///< parent AVCodecContext
|
||||
PutBitContext pb; ///< bitstream writer context
|
||||
AudioDSPContext adsp;
|
||||
AVFloatDSPContext *fdsp;
|
||||
AVFloatDSPContext fdsp;
|
||||
MECmpContext mecc;
|
||||
AC3DSPContext ac3dsp; ///< AC-3 optimized functions
|
||||
FFTContext mdct; ///< FFT context for MDCT calculation
|
||||
|
@@ -139,9 +139,7 @@ static CoefType calc_cpl_coord(CoefSumType energy_ch, CoefSumType energy_cpl)
|
||||
av_cold int ff_ac3_float_encode_init(AVCodecContext *avctx)
|
||||
{
|
||||
AC3EncodeContext *s = avctx->priv_data;
|
||||
s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
if (!s->fdsp)
|
||||
return AVERROR(ENOMEM);
|
||||
avpriv_float_dsp_init(&s->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
|
||||
return ff_ac3_encode_init(avctx);
|
||||
}
|
||||
|
||||
|
@@ -46,20 +46,18 @@ static const AVOption ac3_options[] = {
|
||||
{"off", "Not Dolby Surround Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsur_mode"},
|
||||
{"original", "Original Bit Stream", OFFSET(original), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, 1, AC3ENC_PARAM},
|
||||
/* extended bitstream information */
|
||||
{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DOWNMIX_DPLII, AC3ENC_PARAM, "dmix_mode"},
|
||||
{"dmix_mode", "Preferred Stereo Downmix Mode", OFFSET(preferred_stereo_downmix), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DOWNMIX_LORO, AC3ENC_PARAM, "dmix_mode"},
|
||||
{"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
|
||||
{"ltrt", "Lt/Rt Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LTRT }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
|
||||
{"loro", "Lo/Ro Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_LORO }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dmix_mode"},
|
||||
{"dplii", "Dolby Pro Logic II Downmix Preferred", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DOWNMIX_DPLII }, INT_MIN, INT_MAX, AC3ENC_PARAM, "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, AC3ENC_PARAM},
|
||||
{"ltrt_surmixlev", "Lt/Rt Surround Mix Level", OFFSET(ltrt_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
|
||||
{"loro_cmixlev", "Lo/Ro Center Mix Level", OFFSET(loro_center_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
|
||||
{"loro_surmixlev", "Lo/Ro Surround Mix Level", OFFSET(loro_surround_mix_level), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1.0, 2.0, AC3ENC_PARAM},
|
||||
{"dsurex_mode", "Dolby Surround EX Mode", OFFSET(dolby_surround_ex_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_DSUREX_DPLIIZ, AC3ENC_PARAM, "dsurex_mode"},
|
||||
{"dsurex_mode", "Dolby Surround EX Mode", OFFSET(dolby_surround_ex_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dsurex_mode"},
|
||||
{"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
|
||||
{"on", "Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
|
||||
{"off", "Not Dolby Surround EX Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_OFF }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
|
||||
{"dpliiz", "Dolby Pro Logic IIz-encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_DSUREX_DPLIIZ }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dsurex_mode"},
|
||||
{"dheadphone_mode", "Dolby Headphone Mode", OFFSET(dolby_headphone_mode), AV_OPT_TYPE_INT, {.i64 = AC3ENC_OPT_NONE }, AC3ENC_OPT_NONE, AC3ENC_OPT_MODE_ON, AC3ENC_PARAM, "dheadphone_mode"},
|
||||
{"notindicated", "Not Indicated (default)", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_NOT_INDICATED }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
|
||||
{"on", "Dolby Headphone Encoded", 0, AV_OPT_TYPE_CONST, {.i64 = AC3ENC_OPT_MODE_ON }, INT_MIN, INT_MAX, AC3ENC_PARAM, "dheadphone_mode"},
|
||||
|
@@ -108,7 +108,7 @@ static void apply_mdct(AC3EncodeContext *s)
|
||||
const SampleType *input_samples = &s->planar_samples[ch][blk * AC3_BLOCK_SIZE];
|
||||
|
||||
#if CONFIG_AC3ENC_FLOAT
|
||||
s->fdsp->vector_fmul(s->windowed_samples, input_samples,
|
||||
s->fdsp.vector_fmul(s->windowed_samples, input_samples,
|
||||
s->mdct_window, AC3_WINDOW_SIZE);
|
||||
#else
|
||||
s->ac3dsp.apply_window_int16(s->windowed_samples, input_samples,
|
||||
@@ -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];
|
||||
@@ -443,7 +443,7 @@ int AC3_NAME(encode_frame)(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
ff_ac3_output_frame(s, avpkt->data);
|
||||
|
||||
if (frame->pts != AV_NOPTS_VALUE)
|
||||
avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);
|
||||
avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
|
||||
|
||||
*got_packet_ptr = 1;
|
||||
return 0;
|
||||
|
@@ -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,11 +1524,6 @@ 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);
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -43,12 +43,14 @@ static void adx_encode(ADXContext *c, uint8_t *adx, const int16_t *wav,
|
||||
int s0, s1, s2, d;
|
||||
int max = 0;
|
||||
int min = 0;
|
||||
int data[BLOCK_SAMPLES];
|
||||
|
||||
s1 = prev->s1;
|
||||
s2 = prev->s2;
|
||||
for (i = 0, j = 0; j < 32; i += channels, j++) {
|
||||
s0 = wav[i];
|
||||
d = ((s0 << COEFF_BITS) - c->coeff[0] * s1 - c->coeff[1] * s2) >> COEFF_BITS;
|
||||
data[j] = d;
|
||||
if (max < d)
|
||||
max = d;
|
||||
if (min > d)
|
||||
@@ -56,10 +58,10 @@ static void adx_encode(ADXContext *c, uint8_t *adx, const int16_t *wav,
|
||||
s2 = s1;
|
||||
s1 = s0;
|
||||
}
|
||||
prev->s1 = s1;
|
||||
prev->s2 = s2;
|
||||
|
||||
if (max == 0 && min == 0) {
|
||||
prev->s1 = s1;
|
||||
prev->s2 = s2;
|
||||
memset(adx, 0, BLOCK_SIZE);
|
||||
return;
|
||||
}
|
||||
@@ -75,23 +77,8 @@ static void adx_encode(ADXContext *c, uint8_t *adx, const int16_t *wav,
|
||||
AV_WB16(adx, scale);
|
||||
|
||||
init_put_bits(&pb, adx + 2, 16);
|
||||
|
||||
s1 = prev->s1;
|
||||
s2 = prev->s2;
|
||||
for (i = 0, j = 0; j < 32; i += channels, j++) {
|
||||
d = ((wav[i] << COEFF_BITS) - c->coeff[0] * s1 - c->coeff[1] * s2) >> COEFF_BITS;
|
||||
|
||||
d = av_clip(ROUNDED_DIV(d, scale), -8, 7);
|
||||
|
||||
put_sbits(&pb, 4, d);
|
||||
|
||||
s0 = ((d << COEFF_BITS) * scale + c->coeff[0] * s1 + c->coeff[1] * s2) >> COEFF_BITS;
|
||||
s2 = s1;
|
||||
s1 = s0;
|
||||
}
|
||||
prev->s1 = s1;
|
||||
prev->s2 = s2;
|
||||
|
||||
for (i = 0; i < BLOCK_SAMPLES; i++)
|
||||
put_sbits(&pb, 4, av_clip(data[i] / scale, -8, 7));
|
||||
flush_put_bits(&pb);
|
||||
}
|
||||
|
||||
|
@@ -438,8 +438,8 @@ static av_cold int aic_decode_init(AVCodecContext *avctx)
|
||||
ctx->mb_width = FFALIGN(avctx->width, 16) >> 4;
|
||||
ctx->mb_height = FFALIGN(avctx->height, 16) >> 4;
|
||||
|
||||
ctx->num_x_slices = (ctx->mb_width + 15) >> 4;
|
||||
ctx->slice_width = 16;
|
||||
ctx->num_x_slices = 16;
|
||||
ctx->slice_width = ctx->mb_width / 16;
|
||||
for (i = 1; i < 32; i++) {
|
||||
if (!(ctx->mb_width % i) && (ctx->mb_width / i < 32)) {
|
||||
ctx->slice_width = ctx->mb_width / i;
|
||||
|
@@ -316,11 +316,6 @@ static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
|
||||
int lpc_quant[2];
|
||||
int rice_history_mult[2];
|
||||
|
||||
if (!alac->rice_limit) {
|
||||
avpriv_request_sample(alac->avctx, "Compression with rice limit 0");
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
||||
decorr_shift = get_bits(&alac->gb, 8);
|
||||
decorr_left_weight = get_bits(&alac->gb, 8);
|
||||
|
||||
@@ -533,12 +528,6 @@ static int allocate_buffers(ALACContext *alac)
|
||||
int ch;
|
||||
int buf_size = alac->max_samples_per_frame * sizeof(int32_t);
|
||||
|
||||
for (ch = 0; ch < 2; ch++) {
|
||||
alac->predict_error_buffer[ch] = NULL;
|
||||
alac->output_samples_buffer[ch] = NULL;
|
||||
alac->extra_bits_buffer[ch] = NULL;
|
||||
}
|
||||
|
||||
for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
|
||||
FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch],
|
||||
buf_size, buf_alloc_fail);
|
||||
|
@@ -429,9 +429,10 @@ static void write_element(AlacEncodeContext *s,
|
||||
|
||||
// write extra bits if needed
|
||||
if (s->extra_bits) {
|
||||
uint32_t mask = (1 << s->extra_bits) - 1;
|
||||
for (i = 0; i < s->frame_size; i++) {
|
||||
for (j = 0; j < channels; j++) {
|
||||
put_bits(pb, s->extra_bits, s->predictor_buf[j][i]);
|
||||
put_bits(pb, s->extra_bits, s->predictor_buf[j][i] & mask);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -443,7 +444,7 @@ static void write_element(AlacEncodeContext *s,
|
||||
// TODO: determine when this will actually help. for now it's not used.
|
||||
if (prediction_type == 15) {
|
||||
// 2nd pass 1st order filter
|
||||
int32_t *residual = s->predictor_buf[i];
|
||||
int32_t *residual = s->predictor_buf[channels];
|
||||
for (j = s->frame_size - 1; j > 0; j--)
|
||||
residual[j] -= residual[j - 1];
|
||||
}
|
||||
|
@@ -105,7 +105,6 @@ void avcodec_register_all(void)
|
||||
REGISTER_ENCDEC (AMV, amv);
|
||||
REGISTER_DECODER(ANM, anm);
|
||||
REGISTER_DECODER(ANSI, ansi);
|
||||
REGISTER_DECODER(APNG, apng);
|
||||
REGISTER_ENCDEC (ASV1, asv1);
|
||||
REGISTER_ENCDEC (ASV2, asv2);
|
||||
REGISTER_DECODER(AURA, aura);
|
||||
@@ -491,7 +490,6 @@ void avcodec_register_all(void)
|
||||
REGISTER_DECODER(REALTEXT, realtext);
|
||||
REGISTER_DECODER(SAMI, sami);
|
||||
REGISTER_ENCDEC (SRT, srt);
|
||||
REGISTER_DECODER(STL, stl);
|
||||
REGISTER_ENCDEC (SUBRIP, subrip);
|
||||
REGISTER_DECODER(SUBVIEWER, subviewer);
|
||||
REGISTER_DECODER(SUBVIEWER1, subviewer1);
|
||||
|
@@ -24,14 +24,14 @@
|
||||
#include "asm.h"
|
||||
|
||||
void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
|
||||
ptrdiff_t line_size);
|
||||
int line_size);
|
||||
void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
|
||||
ptrdiff_t line_size);
|
||||
int line_size);
|
||||
|
||||
void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
|
||||
ptrdiff_t line_size);
|
||||
int line_size);
|
||||
void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
|
||||
ptrdiff_t line_size);
|
||||
int line_size);
|
||||
|
||||
#if 0
|
||||
/* These functions were the base for the optimized assembler routines,
|
||||
|
@@ -23,9 +23,9 @@
|
||||
#include <stdint.h>
|
||||
|
||||
extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
|
||||
ptrdiff_t line_size);
|
||||
int line_size);
|
||||
extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
|
||||
ptrdiff_t line_size);
|
||||
int line_size);
|
||||
|
||||
void ff_simple_idct_axp(int16_t *block);
|
||||
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
|
||||
/************************************************************************
|
||||
* void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
|
||||
* ptrdiff_t line_size)
|
||||
* int line_size)
|
||||
*/
|
||||
.align 6
|
||||
.globl put_pixels_clamped_mvi_asm
|
||||
@@ -83,7 +83,7 @@ put_pixels_clamped_mvi_asm:
|
||||
|
||||
/************************************************************************
|
||||
* void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
|
||||
* ptrdiff_t line_size)
|
||||
* int line_size)
|
||||
*/
|
||||
.align 6
|
||||
.globl add_pixels_clamped_mvi_asm
|
||||
|
@@ -357,15 +357,11 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
|
||||
|
||||
ctx->cs_switch = 1;
|
||||
|
||||
for (i = 0; i < avctx->channels; i++) {
|
||||
sconf->chan_pos[i] = -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < avctx->channels; i++) {
|
||||
int idx;
|
||||
|
||||
idx = get_bits(&gb, chan_pos_bits);
|
||||
if (idx >= avctx->channels || sconf->chan_pos[idx] != -1) {
|
||||
if (idx >= avctx->channels) {
|
||||
av_log(avctx, AV_LOG_WARNING, "Invalid channel reordering.\n");
|
||||
ctx->cs_switch = 0;
|
||||
break;
|
||||
@@ -682,7 +678,7 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
|
||||
|
||||
|
||||
if (!sconf->rlslms) {
|
||||
if (sconf->adapt_order && sconf->max_order) {
|
||||
if (sconf->adapt_order) {
|
||||
int opt_order_length = av_ceil_log2(av_clip((bd->block_length >> 3) - 1,
|
||||
2, sconf->max_order + 1));
|
||||
*bd->opt_order = get_bits(gb, opt_order_length);
|
||||
@@ -1246,7 +1242,6 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
|
||||
ALSChannelData *ch = cd[c];
|
||||
unsigned int dep = 0;
|
||||
unsigned int channels = ctx->avctx->channels;
|
||||
unsigned int channel_size = ctx->sconf.frame_length + ctx->sconf.max_order;
|
||||
|
||||
if (reverted[c])
|
||||
return 0;
|
||||
@@ -1277,9 +1272,9 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
|
||||
bd->raw_samples = ctx->raw_samples[c] + offset;
|
||||
|
||||
for (dep = 0; !ch[dep].stop_flag; dep++) {
|
||||
ptrdiff_t smp;
|
||||
ptrdiff_t begin = 1;
|
||||
ptrdiff_t end = bd->block_length - 1;
|
||||
unsigned int smp;
|
||||
unsigned int begin = 1;
|
||||
unsigned int end = bd->block_length - 1;
|
||||
int64_t y;
|
||||
int32_t *master = ctx->raw_samples[ch[dep].master_channel] + offset;
|
||||
|
||||
@@ -1291,28 +1286,11 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
|
||||
|
||||
if (ch[dep].time_diff_sign) {
|
||||
t = -t;
|
||||
if (begin < t) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "begin %td smaller than time diff index %d.\n", begin, t);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
begin -= t;
|
||||
} else {
|
||||
if (end < t) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "end %td smaller than time diff index %d.\n", end, t);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
end -= t;
|
||||
}
|
||||
|
||||
if (FFMIN(begin - 1, begin - 1 + t) < ctx->raw_buffer - master ||
|
||||
FFMAX(end + 1, end + 1 + t) > ctx->raw_buffer + channels * channel_size - master) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR,
|
||||
"sample pointer range [%p, %p] not contained in raw_buffer [%p, %p].\n",
|
||||
master + FFMIN(begin - 1, begin - 1 + t), master + FFMAX(end + 1, end + 1 + t),
|
||||
ctx->raw_buffer, ctx->raw_buffer + channels * channel_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (smp = begin; smp < end; smp++) {
|
||||
y = (1 << 6) +
|
||||
MUL64(ch[dep].weighting[0], master[smp - 1 ]) +
|
||||
@@ -1325,16 +1303,6 @@ static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
|
||||
bd->raw_samples[smp] += y >> 7;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (begin - 1 < ctx->raw_buffer - master ||
|
||||
end + 1 > ctx->raw_buffer + channels * channel_size - master) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR,
|
||||
"sample pointer range [%p, %p] not contained in raw_buffer [%p, %p].\n",
|
||||
master + begin - 1, master + end + 1,
|
||||
ctx->raw_buffer, ctx->raw_buffer + channels * channel_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (smp = begin; smp < end; smp++) {
|
||||
y = (1 << 6) +
|
||||
MUL64(ch[dep].weighting[0], master[smp - 1]) +
|
||||
@@ -1493,11 +1461,6 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
|
||||
|
||||
// TODO: read_diff_float_data
|
||||
|
||||
if (get_bits_left(gb) < 0) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "Overread %d\n", -get_bits_left(gb));
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1702,12 +1665,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
avctx->sample_fmt = sconf->resolution > 1
|
||||
? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
|
||||
avctx->bits_per_raw_sample = (sconf->resolution + 1) * 8;
|
||||
if (avctx->bits_per_raw_sample > 32) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Bits per raw sample %d larger than 32.\n",
|
||||
avctx->bits_per_raw_sample);
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
// set maximum Rice parameter for progressive decoding based on resolution
|
||||
@@ -1770,9 +1727,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
|
||||
// allocate and assign channel data buffer for mcc mode
|
||||
if (sconf->mc_coding) {
|
||||
ctx->chan_data_buffer = av_mallocz(sizeof(*ctx->chan_data_buffer) *
|
||||
ctx->chan_data_buffer = av_malloc(sizeof(*ctx->chan_data_buffer) *
|
||||
num_buffers * num_buffers);
|
||||
ctx->chan_data = av_mallocz(sizeof(*ctx->chan_data) *
|
||||
ctx->chan_data = av_malloc(sizeof(*ctx->chan_data) *
|
||||
num_buffers);
|
||||
ctx->reverted_channels = av_malloc(sizeof(*ctx->reverted_channels) *
|
||||
num_buffers);
|
||||
|
@@ -47,10 +47,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size);
|
||||
if (bytestream2_get_bytes_left(&s->gb) < 16 * 8 + 4 * 256) {
|
||||
av_frame_free(&s->frame);
|
||||
if (bytestream2_get_bytes_left(&s->gb) < 16 * 8 + 4 * 256)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
bytestream2_skipu(&s->gb, 16 * 8);
|
||||
for (i = 0; i < 256; i++)
|
||||
|
@@ -90,11 +90,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
s->fg = DEFAULT_FG_COLOR;
|
||||
s->bg = DEFAULT_BG_COLOR;
|
||||
|
||||
if (!avctx->width || !avctx->height) {
|
||||
int ret = ff_set_dimensions(avctx, 80 << 3, 25 << 4);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
if (!avctx->width || !avctx->height)
|
||||
ff_set_dimensions(avctx, 80 << 3, 25 << 4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -601,14 +601,14 @@ static void decode_array_0000(APEContext *ctx, GetBitContext *gb,
|
||||
int ksummax, ksummin;
|
||||
|
||||
rice->ksum = 0;
|
||||
for (i = 0; i < FFMIN(blockstodecode, 5); i++) {
|
||||
for (i = 0; i < 5; i++) {
|
||||
out[i] = get_rice_ook(&ctx->gb, 10);
|
||||
rice->ksum += out[i];
|
||||
}
|
||||
rice->k = av_log2(rice->ksum / 10) + 1;
|
||||
if (rice->k >= 24)
|
||||
return;
|
||||
for (; i < FFMIN(blockstodecode, 64); i++) {
|
||||
for (; i < 64; i++) {
|
||||
out[i] = get_rice_ook(&ctx->gb, rice->k);
|
||||
rice->ksum += out[i];
|
||||
rice->k = av_log2(rice->ksum / ((i + 1) * 2)) + 1;
|
||||
@@ -905,9 +905,6 @@ static void long_filter_high_3800(int32_t *buffer, int order, int shift,
|
||||
int i, j;
|
||||
int32_t dotprod, sign;
|
||||
|
||||
if (order >= length)
|
||||
return;
|
||||
|
||||
memset(coeffs, 0, order * sizeof(*coeffs));
|
||||
for (i = 0; i < order; i++)
|
||||
delay[i] = buffer[i];
|
||||
@@ -1387,7 +1384,7 @@ static void ape_unpack_stereo(APEContext *ctx, int count)
|
||||
int32_t *decoded0 = ctx->decoded[0];
|
||||
int32_t *decoded1 = ctx->decoded[1];
|
||||
|
||||
if ((ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) == APE_FRAMECODE_STEREO_SILENCE) {
|
||||
if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {
|
||||
/* We are pure silence, so we're done. */
|
||||
av_log(ctx->avctx, AV_LOG_DEBUG, "pure silence stereo\n");
|
||||
return;
|
||||
@@ -1479,13 +1476,13 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
|
||||
nblocks);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
s->samples = nblocks;
|
||||
|
||||
/* Initialize the frame decoder */
|
||||
if (init_frame_decoder(s) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error reading frame header\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
s->samples = nblocks;
|
||||
}
|
||||
|
||||
if (!s->data) {
|
||||
|
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* APNG common header
|
||||
* Copyright (c) 2014 Benoit Fouet
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* APNG common header
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_APNG_H
|
||||
#define AVCODEC_APNG_H
|
||||
|
||||
enum {
|
||||
APNG_DISPOSE_OP_NONE = 0,
|
||||
APNG_DISPOSE_OP_BACKGROUND = 1,
|
||||
APNG_DISPOSE_OP_PREVIOUS = 2,
|
||||
};
|
||||
|
||||
enum {
|
||||
APNG_BLEND_OP_SOURCE = 0,
|
||||
APNG_BLEND_OP_OVER = 1,
|
||||
};
|
||||
|
||||
#endif /* AVCODEC_APNG_H */
|
@@ -24,7 +24,7 @@
|
||||
void ff_flac_lpc_16_arm(int32_t *samples, const int coeffs[32], int order,
|
||||
int qlevel, int len);
|
||||
|
||||
av_cold void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt, int channels,
|
||||
av_cold void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt,
|
||||
int bps)
|
||||
{
|
||||
if (bps <= 16 && CONFIG_FLAC_DECODER)
|
||||
|
@@ -107,10 +107,8 @@ av_cold void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth,
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
#if HAVE_ARMV6
|
||||
if (have_setend(cpu_flags))
|
||||
c->startcode_find_candidate = ff_startcode_find_candidate_armv6;
|
||||
#endif
|
||||
if (have_neon(cpu_flags))
|
||||
h264dsp_init_neon(c, bit_depth, chroma_format_idc);
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#include "config.h"
|
||||
#include "libavutil/arm/asm.S"
|
||||
|
||||
@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, ptrdiff_t stride)
|
||||
@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, int stride)
|
||||
function ff_add_pixels_clamped_arm, export=1, align=5
|
||||
push {r4-r10}
|
||||
mov r10, #8
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#include "idctdsp_arm.h"
|
||||
|
||||
void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
|
||||
ptrdiff_t line_size);
|
||||
int line_size);
|
||||
|
||||
/* XXX: those functions should be suppressed ASAP when all IDCTs are
|
||||
* converted */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user