Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cebe51a625 | |||
| 9d58639e27 |
@@ -1,762 +1,7 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 2.8.12:
|
||||
- avcodec/mjpegdec: Check that reference frame matches the current frame
|
||||
- avcodec/tiff: Avoid loosing allocated geotag values
|
||||
- avcodec/cavs: Fix runtime error: signed integer overflow: -12648062 * 256 cannot be represented in type 'int'
|
||||
- avformat/hls: Check local file extensions
|
||||
- avcodec/qdrw: Fix null pointer dereference
|
||||
- avutil/softfloat: Fix sign error in and improve documentation of av_int2sf()
|
||||
- avcodec/hevc_ps: Fix runtime error: index 32 out of bounds for type 'uint8_t [32]'
|
||||
- avcodec/pafvideo: Check packet size and frame code before ff_reget_buffer()
|
||||
- avcodec/ac3dec_fixed: Fix runtime error: left shift of 419 by 23 places cannot be represented in type 'int'
|
||||
- avcodec/aacps: Fix runtime error: left shift of 1073741824 by 1 places cannot be represented in type 'INTFLOAT' (aka 'int')
|
||||
- avcodec/wavpack: Fix runtime error: shift exponent 32 is too large for 32-bit type 'int'
|
||||
- avcodec/wavpack: Fix runtime error: signed integer overflow: 2013265955 - -134217694 cannot be represented in type 'int'
|
||||
- avcodec/cinepak: Check input packet size before frame reallocation
|
||||
- avcodec/hevc_ps: Fix runtime error: signed integer overflow: 2147483628 + 256 cannot be represented in type 'int'
|
||||
- avcodec/ra144: Fixes runtime error: signed integer overflow: 7160 * 327138 cannot be represented in type 'int'
|
||||
- avcodec/pnm: Use ff_set_dimensions()
|
||||
- avcodec/cavsdec: Fix runtime error: signed integer overflow: 59 + 2147483600 cannot be represented in type 'int'
|
||||
- avformat/avidec: Limit formats in gab2 to srt and ass/ssa
|
||||
- avcodec/acelp_pitch_delay: Fix runtime error: value 4.83233e+39 is outside the range of representable values of type 'float'
|
||||
- avcodec/wavpack: Check float_shift
|
||||
- avcodec/wavpack: Fix runtime error: signed integer overflow: 24 * -2147483648 cannot be represented in type 'int'
|
||||
- avcodec/ansi: Fix frame memleak
|
||||
- avcodec/jpeg2000dec: Use ff_set_dimensions()
|
||||
- avcodec/truemotion2: Fix passing null pointer to memset()
|
||||
- avcodec/truemotion2: Fix runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
|
||||
- avcodec/ra144: Fix runtime error: signed integer overflow: -2449 * 1398101 cannot be represented in type 'int'
|
||||
- avcodec/ra144: Fix runtime error: signed integer overflow: 11184810 * 404 cannot be represented in type 'int'
|
||||
- avcodec/aac_defines: Add missing () to AAC_HALF_SUM() macro
|
||||
- avcodec/webp: Fixes null pointer dereference
|
||||
- avcodec/aacdec_fixed: Fix runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
|
||||
- avcodec/snow: Fix runtime error: signed integer overflow: 1086573993 + 1086573994 cannot be represented in type 'int'
|
||||
- avcodec/jpeg2000: Fix runtime error: signed integer overflow: 4185 + 2147483394 cannot be represented in type 'int'
|
||||
- avcodec/jpeg2000dec: Check tile offsets more completely
|
||||
- avcodec/aacdec_fixed: Fix multiple runtime error: shift exponent 127 is too large for 32-bit type 'int'
|
||||
- avcodec/wnv1: More strict buffer size check
|
||||
- avcodec/libfdk-aacdec: Correct buffer_size parameter
|
||||
- avcodec/sbrdsp_template: Fix: runtime error: signed integer overflow: 849815297 + 1315389781 cannot be represented in type 'int'
|
||||
- avcodec/ivi_dsp: Fix runtime error: left shift of negative value -2
|
||||
- doc/filters: Clarify scale2ref example
|
||||
- avcodec/mlpdec: Do not leave invalid values in matrix_out_ch[] on error
|
||||
- avcodec/ra144dec: Fix runtime error: left shift of negative value -17
|
||||
- avformat/mux: Fix copy an paste typo
|
||||
- avutil/internal: Do not enable CHECKED with DEBUG
|
||||
- avcodec/aacdec_fixed: Fix runtime error: signed integer overflow: -2147483648 * -1 cannot be represented in type 'int'
|
||||
- avcodec/smc: Check remaining input
|
||||
- avcodec/jpeg2000dec: Fix copy and paste error
|
||||
- avcodec/jpeg2000dec: Check tile offsets
|
||||
- avcodec/sanm: Fix uninitialized reference frames
|
||||
- avcodec/jpeglsdec: Check get_bits_left() before decoding a picture
|
||||
- avcodec/ivi_dsp: Fix multiple runtime error: left shift of negative value -71
|
||||
- avcodec/mjpegdec: Fix runtime error: signed integer overflow: -32767 * 130560 cannot be represented in type 'int'
|
||||
- avcodec/aacdec_fixed: Fix runtime error: shift exponent 34 is too large for 32-bit type 'int'
|
||||
- avcodec/mpeg4videodec: Check for multiple VOL headers
|
||||
- avcodec/vmnc: Check location before use
|
||||
- avcodec/takdec: Fix runtime error: signed integer overflow: 8192 * 524308 cannot be represented in type 'int'
|
||||
- avcodec/aac_defines: Fix: runtime error: left shift of negative value -2
|
||||
- avcodec/takdec: Fix runtime error: left shift of negative value -63
|
||||
- avcodec/mlpdsp: Fix runtime error: signed integer overflow: -24419392 * 128 cannot be represented in type 'int'
|
||||
- avcodec/sbrdsp_fixed: fix runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
|
||||
- avcodec/aacsbr_fixed: Fix multiple runtime error: shift exponent 170 is too large for 32-bit type 'int'
|
||||
- avcodec/hevc_sei: fix amount of bits skipped when reading picture timing SEI message
|
||||
- avformat/concatdec: fix the h264 annexb extradata check
|
||||
- avformat/utils: free AVStream.codec properly in free_stream()
|
||||
- avcodec/options: do a more thorough clean up in avcodec_copy_context()
|
||||
- avcodec/options: factorize avcodec_copy_context() cleanup code
|
||||
- avcodec/mlpdec: Do not leave a invalid num_primitive_matrices in the context
|
||||
- avcodec/aacsbr_fixed: Fix multiple runtime error: shift exponent 150 is too large for 32-bit type 'int'
|
||||
- avcodec/mimic: Use ff_set_dimensions() to set the dimensions
|
||||
- avcodec/fic: Fix multiple runtime error: signed integer overflow: 5793 * 419752 cannot be represented in type 'int'
|
||||
- avcodec/mlpdec: Fix: runtime error: left shift of negative value -8
|
||||
- avcodec/dfa: Fix: runtime error: signed integer overflow: -14202 * 196877 cannot be represented in type 'int'
|
||||
- avcodec/aacdec: Fix runtime error: signed integer overflow: 2147483520 + 255 cannot be represented in type 'int'
|
||||
- avcodec/aacdec_template: Fix fixed point scale in decode_cce()
|
||||
- avcodec/flicvideo: Check frame_size before decrementing
|
||||
- avcodec/mlpdec: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/takdec: Fix runtime error: left shift of negative value -42
|
||||
- avcodec/hq_hqa: Fix: runtime error: signed integer overflow: -255 * 10180917 cannot be represented in type 'int'
|
||||
- avcodec/truemotion1: Fix multiple runtime error: signed integer overflow: 1246906962 * 2 cannot be represented in type 'int'
|
||||
- avcodec/svq3: Fix runtime error: left shift of negative value -6
|
||||
- avcodec/tiff: reset sampling[] if its invalid
|
||||
- avcodec/aacps: Fix undefined behavior
|
||||
- avcodec/opus_silk: Fix integer overflow and out of array read
|
||||
- avcodec/flacdec: Return error code instead of 0 for failures
|
||||
- avcodec/snowdec: Check width
|
||||
- avcodec/webp: Update canvas size in vp8_lossy_decode_frame() as in vp8_lossless_decode_frame()
|
||||
- avcodec/webp: Factor update_canvas_size() out
|
||||
- avcodec/cllc: Check prefix
|
||||
- avcodec/dds: Fix runtime error: left shift of 210 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/mpeg4videodec: Clear sprite wraping on unsupported cases in VOP decode
|
||||
- avcodec/ac3dec: Fix: runtime error: index -1 out of bounds for type 'INTFLOAT [2]'
|
||||
- avcodec/hqxdsp: Fix runtime error: signed integer overflow: -196264 * 11585 cannot be represented in type 'int'
|
||||
- libswscale/tests/swscale: Fix uninitialized variables
|
||||
- avcodec/ffv1dec: Fix runtime error: signed integer overflow: 1550964438 + 1550964438 cannot be represented in type 'int'
|
||||
- avcodec/webp: Fix signedness in prefix_code check
|
||||
- avcodec/svq3: Fix runtime error: signed integer overflow: 169 * 12717677 cannot be represented in type 'int'
|
||||
- avcodec/mlpdec: Check that there is enough data for headers
|
||||
- avcodec/ac3dec: Keep track of band structure
|
||||
- avcodec/webp: Add missing input padding
|
||||
- avcodec/aacdec_fixed: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/aacsbr_template: Do not change bs_num_env before its checked
|
||||
- avcodec/mlp: Fix multiple runtime error: left shift of negative value -1
|
||||
- avcodec/vp8dsp: vp7_luma_dc_wht_c: Fix multiple runtime error: signed integer overflow: -1366381240 + -1262413604 cannot be represented in type 'int'
|
||||
- avcodec/avcodec: Limit the number of side data elements per packet
|
||||
- avcodec/texturedsp: Fix runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/wmv2dsp: Fix runtime error: signed integer overflow: 181 * -17047030 cannot be represented in type 'int'
|
||||
- avcodec/diracdec: Fix Assertion frame->buf[0] failed at libavcodec/decode.c:610
|
||||
- avcodec/msmpeg4dec: Check for cbpy VLC errors
|
||||
- avcodec/cllc: Check num_bits
|
||||
- avcodec/cllc: Factor VLC_BITS/DEPTH out, do not use repeated literal numbers
|
||||
- avcodec/dvbsubdec: Check entry_id
|
||||
- avcodec/aacdec_fixed: Fix multiple shift exponent 33 is too large for 32-bit type 'int'
|
||||
- avcodec/mpeg12dec: Fixes runtime error: division by zero
|
||||
- avcodec/webp: Always set pix_fmt
|
||||
- avfilter/vf_uspp: Fix currently unused input frame dimensions
|
||||
- avcodec/truemotion1: Fix multiple runtime error: left shift of negative value -1
|
||||
- avcodec/eatqi: Fix runtime error: signed integer overflow: 4466147 * 1075 cannot be represented in type 'int'
|
||||
- avcodec/dss_sp: Fix runtime error: signed integer overflow: 2147481189 + 4096 cannot be represented in type 'int'
|
||||
- avformat/wavdec: Check chunk_size
|
||||
- avcodec/cavs: Check updated MV
|
||||
- avcodec/y41pdec: Fix width in input buffer size check
|
||||
- avcodec/svq3: Fix multiple runtime error: signed integer overflow: -237341 * 24552 cannot be represented in type 'int'
|
||||
- avcodec/texturedsp: Fix runtime error: left shift of 218 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/lagarith: Check scale_factor
|
||||
- avcodec/lagarith: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/takdec: Fix multiple runtime error: left shift of negative value -1
|
||||
- avcodec/indeo2: Check for invalid VLCs
|
||||
- avcodec/htmlsubtitles: Check for string truncation and return error
|
||||
- avcodec/bmvvideo: Fix runtime error: left shift of 137 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/dss_sp: Fix multiple runtime error: signed integer overflow: -15699 * -164039 cannot be represented in type 'int'
|
||||
- avcodec/dvbsubdec: check region dimensions
|
||||
- avcodec/vp8dsp: Fixes: runtime error: signed integer overflow: 1330143360 - -1023040530 cannot be represented in type 'int'
|
||||
- avcodec/hqxdsp: Fix multiple runtime error: signed integer overflow: 248220 * 21407 cannot be represented in type 'int' in idct_col()
|
||||
- avcodec/cavsdec: Check sym_factor
|
||||
- avcodec/cdxl: Check format for BGR24
|
||||
- avcodec/ffv1dec: Fix copying planes of paletted formats
|
||||
- avcodec/wmv2dsp: Fix runtime error: signed integer overflow: 181 * -12156865 cannot be represented in type 'int'
|
||||
- avcodec/xwddec: Check bpp more completely
|
||||
- avcodec/s302m: Fix left shift of 8 by 28 places cannot be represented in type 'int'
|
||||
- avcodec/eamad: Fix runtime error: signed integer overflow: 49674 * 49858 cannot be represented in type 'int'
|
||||
- avcodec/g726: Fix runtime error: left shift of negative value -2
|
||||
- avcodec/ra144: Fix runtime error: left shift of negative value -798
|
||||
- avcodec/mss34dsp: Fix multiple signed integer overflow
|
||||
- avcodec/targa_y216dec: Fix width type
|
||||
- avcodec/ivi_dsp: Fix multiple left shift of negative value -2
|
||||
- avcodec/svq3: Fix multiple runtime error: signed integer overflow: 44161 * 61694 cannot be represented in type 'int'
|
||||
- avcodec/msmpeg4dec: Correct table depth
|
||||
- avcodec/dds: Fix runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
|
||||
- avcodec/cdxl: Check format parameter
|
||||
- avutil/softfloat: Fix overflow in av_div_sf()
|
||||
- avcodec/hq_hqa: Fix runtime error: left shift of negative value -207
|
||||
- avcodec/mss3: Change types in rac_get_model_sym() to match the types they are initialized from
|
||||
- avcodec/shorten: Check k in get_uint()
|
||||
- avcodec/webp: Fix null pointer dereference
|
||||
- avcodec/dfa: Fix signed integer overflow: -2147483648 - 1 cannot be represented in type 'int'
|
||||
- avcodec/mimic: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/fic: Fix multiple left shift of negative value -15
|
||||
- avcodec/mlpdec: Fix runtime error: left shift of negative value -22
|
||||
- avcodec/snowdec: Check qbias
|
||||
- avutil/softfloat: Fix multiple runtime error: left shift of negative value -8
|
||||
- avcodec/aacsbr_template: Do not leave bs_num_env invalid
|
||||
- avcodec/mdec: Fix signed integer overflow: 28835400 * 83 cannot be represented in type 'int'
|
||||
- avcodec/dfa: Fix off by 1 error
|
||||
- avcodec/nellymoser: Fix multiple left shift of negative value -8591
|
||||
- avcodec/cdxl: Fix signed integer overflow: 14243456 * 164 cannot be represented in type 'int'
|
||||
- avcodec/g722: Fix multiple runtime error: left shift of negative value -1
|
||||
- avcodec/dss_sp: Fix multiple left shift of negative value -466
|
||||
- avcodec/wnv1: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/tiertexseqv: set the fixed dimenasions, do not depend on the demuxer doing so
|
||||
- avcodec/mjpegdec: Fix runtime error: signed integer overflow: -24543 * 2031616 cannot be represented in type 'int'
|
||||
- avcodec/cavsdec: Fix undefined behavior from integer overflow
|
||||
- avcodec/dvdsubdec: Fix runtime error: left shift of 242 by 24 places cannot be represented in type 'int'
|
||||
- libavcodec/mpeg4videodec: Convert sprite_offset to 64bit
|
||||
- avcodec/pngdec: Use ff_set_dimensions()
|
||||
- avcodec/msvideo1: Check buffer size before re-getting the frame
|
||||
- avcodec/h264_cavlc: Fix undefined behavior on qscale overflow
|
||||
- avcodec/svq3: Increase offsets to prevent integer overflows
|
||||
- avcodec/indeo2: Check remaining bits in ir2_decode_plane()
|
||||
- avcodec/vp3: Check remaining bits in unpack_dct_coeffs()
|
||||
- avcodec/mdec: Fix runtime error: left shift of negative value -127
|
||||
- libavcodec/exr : fix float to uint16 conversion for negative float value
|
||||
- avformat/webmdashenc: Validate the 'streams' adaptation sets parameter
|
||||
- avformat/webmdashenc: Require the 'adaptation_sets' option to be set
|
||||
- avcodec/dvdsubdec: Fixes 2 runtime error: left shift of 170 by 24 places cannot be represented in type 'int'
|
||||
- avfilter/avfiltergraph: Add assert to write down in machine readable form what is assumed about sample rates in swap_samplerates_on_filter()
|
||||
- avcodec/tiff: Perform multiply in tiff_unpack_lzma() as 64bit
|
||||
- avcodec/vdpau_hevc: Fix potential out-of-bounds write
|
||||
- avcodec/tiff: Check geotag count for being non zero
|
||||
- avcodec/vp56: Check avctx->error_concealment before enabling EC
|
||||
- avcodec/tiff: Check stripsize strippos for overflow
|
||||
- avcodec/mpegaudiodec_template: Make l3_unscale() work with e=0
|
||||
- avcodec/tiff: Check for multiple geo key directories
|
||||
- avcodec/wavpack: Fix runtime error: shift exponent 32 is too large for 32-bit type 'int'
|
||||
- avcodec/rv34: Fix runtime error: signed integer overflow: 36880 * 66288 cannot be represented in type 'int'
|
||||
- avcodec/amrwbdec: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/mpeg4videodec: Fix runtime error: signed integer overflow: -135088512 * 16 cannot be represented in type 'int'
|
||||
- avcodec/h264_mvpred: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/mjpegdec: Fix runtime error: left shift of negative value -127
|
||||
- avcodec/wavpack: Fix runtime error: left shift of negative value -5
|
||||
- avcodec/wavpack: Fix runtime error: left shift of negative value -2
|
||||
- avcodec/mpeg4videodec: Fix runtime error: signed integer overflow: 134527392 * 16 cannot be represented in type 'int'
|
||||
- avcodec/mpeg12dec: Fix runtime error: left shift of negative value -13
|
||||
- avcodec/h264_mvpred: Fix multiple runtime error: left shift of negative value
|
||||
- avcodec/adxdec: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/mpeg4videodec: Improve the overflow checks in mpeg4_decode_sprite_trajectory()
|
||||
- avcodec/mjpegdec: Fix runtime error: left shift of negative value -511
|
||||
- avcodec/h264_direct: Fix runtime error: left shift of negative value -14
|
||||
- avcodec/pictordec: Check plane value before doing value/mask computations
|
||||
- avcodec/mpeg4videodec: Fix runtime error: left shift of negative value -2650
|
||||
- avcodec/eac3dec: Fix runtime error: left shift of negative value -3
|
||||
- avcodec/mpeg12dec: Fix runtime error: left shift of negative value -2
|
||||
- avcodec/mpeg4videodec: Check the other 3 sprite points for intermediate overflows
|
||||
- avcodec/mpeg4videodec: Check sprite_offset in addition to shifts
|
||||
- avcodec/mpeg4video: Fix runtime error: left shift of negative value
|
||||
- avcodec/ituh263dec: Fix runtime error: left shift of negative value -22
|
||||
- avcodec/rv40: Fix runtime error: left shift of negative value
|
||||
- avcodec/h264_cabac: runtime error: signed integer overflow: 2147483647 + 14 cannot be represented in type 'int'
|
||||
- avcodec/mpeg4videodec: Fix runtime error: shift exponent -2 is negative
|
||||
- avcodec/mjpegdec: Fix runtime error: left shift of negative value -507
|
||||
- avcodec/eac3dec: Fix runtime error: left shift of negative value
|
||||
- avcodec/vp6: clear dimensions on failed resolution change in vp6_parse_header()
|
||||
- avcodec/vp56: Reset have_undamaged_frame on resolution changes
|
||||
- avcodec/vp8: Fix hang with slice threads
|
||||
- avcodec/vp8: Check for the bitstream end per MB in decode_mb_row_no_filter()
|
||||
- avcodec/vp568: Check that there is enough data for ff_vp56_init_range_decoder()
|
||||
- avcodec/vp8: remove redundant check
|
||||
- avcodec/vp56: Require a correctly decoded frame before using vp56_conceal_mb()
|
||||
- avcodec/vp3: Do not return random positive values but the buf size
|
||||
- avcodec/vp8: Check for bitsteam end in decode_mb_row_no_filter()
|
||||
- avcodec/vp56: Factorize vp56_render_mb() out
|
||||
- avcodec/vp3dsp: Fix multiple signed integer overflow: 46341 * 47523 cannot be represented in type 'int'
|
||||
- Add CHECK/SUINT code
|
||||
- avcodec/mpeg12dec: Fix runtime error: left shift of negative value -1
|
||||
- avcodec/vp56: Clear dimensions in case of failure in the middle of a resolution change
|
||||
- avcodec/vp56: Implement very basic error concealment
|
||||
- avcodec/amrwbdec: Fix 2 runtime errors: left shift of negative value -1
|
||||
- avcodec/pngdec: Fix runtime error: left shift of 152 by 24 places cannot be represented in type 'int'
|
||||
- avcodec/vp56: Fix sign typo
|
||||
- avcodec/mpegaudiodec_template: Correct return code on id3 tag discarding
|
||||
- avcodec/rv34: Simplify and factor get_slice_offset() code
|
||||
- avcodec/pictordec: Do not read more than nb_planes
|
||||
- avcodec/srtdec: Fix signed integer overflow: 1811992524 * 384 cannot be represented in type 'int'
|
||||
- avcodec/pngdec: Check bit depth for validity
|
||||
- avcodec/mpeg12dec: Fix runtime error: left shift of negative value
|
||||
- avcodec/wavpacl: Fix runtime error: left shift of negative value -1
|
||||
- avformat/http: Check for truncated buffers in http_connect()
|
||||
- (github/release/2.8) avformat/apng: fix setting frame delay when max_fps is set to no limit
|
||||
- swresample/resample: free existing ResampleContext on reinit
|
||||
- swresample/resample: move resample_free() higher in the file
|
||||
- lavf/mpeg: Initialize a stack variable used by memcmp().
|
||||
- lavc/avpacket: Initialize a variable in error path.
|
||||
|
||||
version 2.8.11
|
||||
- avcodec/h264_slice: Clear ref_counts on redundant slices
|
||||
- lavf/mov.c: Avoid heap allocation wrap in mov_read_uuid
|
||||
- lavf/mov.c: Avoid heap allocation wrap in mov_read_hdlr
|
||||
- avcodec/pictordec: Fix logic error
|
||||
- avcodec/movtextdec: Fix decode_styl() cleanup
|
||||
- lavf/matroskadec: fix is_keyframe for early Blocks
|
||||
- configure: bump year
|
||||
- avcodec/pngdec: Check trns more completely
|
||||
- avcodec/interplayvideo: Move parameter change check up
|
||||
- avcodec/mjpegdec: Check for for the bitstream end in mjpeg_decode_scan_progressive_ac()
|
||||
- avformat/flacdec: Check avio_read result when reading flac block header.
|
||||
- avcodec/utils: correct align value for interplay
|
||||
- avcodec/vp56: Check for the bitstream end, pass error codes on
|
||||
- avcodec/mjpegdec: Check remaining bitstream in ljpeg_decode_yuv_scan()
|
||||
- avcodec/pngdec: Fix off by 1 size in decode_zbuf()
|
||||
- avformat/avidec: skip odml master index chunks in avi_sync
|
||||
- avcodec/mjpegdec: Check for rgb before flipping
|
||||
- avutil/random_seed: Reduce the time needed on systems with very low precision clock()
|
||||
- avutil/random_seed: Improve get_generic_seed() with higher precision clock()
|
||||
- avformat/utils: Print verbose error message if stream count exceeds max_streams
|
||||
- avformat/options_table: Set the default maximum number of streams to 1000
|
||||
- avutil: Add av_image_check_size2()
|
||||
- avformat: Add max_streams option
|
||||
- avcodec/ffv1enc: Allocate smaller packet if the worst case size cannot be allocated
|
||||
- avcodec/mpeg4videodec: Fix undefined shifts in mpeg4_decode_sprite_trajectory()
|
||||
- avformat/oggdec: Skip streams in duration correction that did not had their duration set.
|
||||
- avcodec/ffv1enc: Fix size of first slice
|
||||
- pgssubdec: reset rle_data_len/rle_remaining_len on allocation error
|
||||
|
||||
version 2.8.10
|
||||
- avformat/http: Match chunksize checks to master..3.0
|
||||
- Changelog: fix typos
|
||||
- ffserver: Check chunk size
|
||||
- Avoid using the term "file" and prefer "url" in some docs and comments
|
||||
- avformat/rtmppkt: Check for packet size mismatches
|
||||
- zmqsend: Initialize ret to 0
|
||||
- configure: check for strtoull on msvc
|
||||
- http: move chunk handling from http_read_stream() to http_buf_read().
|
||||
- http: make length/offset-related variables unsigned.
|
||||
|
||||
version 2.8.9
|
||||
- avcodec/flacdec: Fix undefined shift in decode_subframe()
|
||||
- avcodec/get_bits: Fix get_sbits_long(0)
|
||||
- avformat/ffmdec: Check media type for chunks
|
||||
- avcodec/flacdec: Fix signed integer overflow in decode_subframe_fixed()
|
||||
- avcodec/flacdsp_template: Fix undefined shift in flac_decorrelate_indep_c
|
||||
- avformat/oggparsespeex: Check frames_per_packet and packet_size
|
||||
- avformat/utils: Check start/end before computing duration in update_stream_timings()
|
||||
- avcodec/flac_parser: Update nb_headers_buffered
|
||||
- avformat/idroqdec: Check chunk_size for being too large
|
||||
- filmstripdec: correctly check image dimensions
|
||||
- mss2: only use error correction for matching block counts
|
||||
- softfloat: decrease MIN_EXP to cover full float range
|
||||
- libopusdec: default to stereo for invalid number of channels
|
||||
- sbgdec: prevent NULL pointer access
|
||||
- smacker: limit recursion depth of smacker_decode_bigtree
|
||||
- mxfdec: fix NULL pointer dereference in mxf_read_packet_old
|
||||
- libschroedingerdec: fix leaking of framewithpts
|
||||
- libschroedingerdec: don't produce empty frames
|
||||
- softfloat: handle -INT_MAX correctly
|
||||
- pnmdec: make sure v is capped by maxval
|
||||
- smvjpegdec: make sure cur_frame is not negative
|
||||
- icodec: correctly check avio_read return value
|
||||
- icodec: fix leaking pkt on error
|
||||
- dvbsubdec: fix division by zero in compute_default_clut
|
||||
- proresdec_lgpl: explicitly check coff[3] against slice_data_size
|
||||
- escape124: reject codebook size 0
|
||||
- mpegts: prevent division by zero
|
||||
- matroskadec: fix NULL pointer dereference in webm_dash_manifest_read_header
|
||||
- mpegaudio_parser: don't return AVERROR_PATCHWELCOME
|
||||
- mxfdec: fix NULL pointer dereference
|
||||
- diracdec: check return code of get_buffer_with_edge
|
||||
- ppc: pixblockdsp: do unaligned block accesses correctly again
|
||||
- mpeg12dec: unref discarded picture from extradata
|
||||
- cavsdec: unref frame before referencing again
|
||||
- avformat: prevent triggering request_probe assert in ff_read_packet
|
||||
- avformat/mpeg: Adjust vid probe threshold to correct mis-detection
|
||||
- avcodec/rv40: Test remaining space in loop of get_dimension()
|
||||
- avcodec/ituh263dec: Avoid spending a long time in slice sync
|
||||
- avcodec/movtextdec: Add error message for tsmb_size check
|
||||
- avcodec/movtextdec: Fix tsmb_size check==0 check
|
||||
- avcodec/movtextdec: Fix potential integer overflow
|
||||
- avcodec/sunrast: Fix input buffer pointer check
|
||||
- avcodec/tscc: Check side data size before use
|
||||
- avcodec/rawdec: Check side data size before use
|
||||
- avcodec/msvideo1: Check side data size before use
|
||||
- avcodec/qpeg: Check side data size before use
|
||||
- avcodec/qtrle: Check side data size before use
|
||||
- avcodec/msrle: Check side data size before use
|
||||
- avcodec/kmvc: Check side data size before use
|
||||
- avcodec/idcinvideo: Check side data size before use
|
||||
- avcodec/cinepak: Check side data size before use
|
||||
- avcodec/8bps: Check side data size before use
|
||||
- avcodec/dvdsubdec: Fix off by 1 error
|
||||
- avcodec/dvdsubdec: Fix buf_size check
|
||||
- vp9: change order of operations in adapt_prob().
|
||||
- avcodec/interplayvideo: Check side data size before use
|
||||
- avformat/mxfdec: Check size to avoid integer overflow in mxf_read_utf16_string()
|
||||
- avcodec/mpegvideo_enc: Clear mmx state in ff_mpv_reallocate_putbitbuffer()
|
||||
- avcodec/utils: Clear MMX state before returning from avcodec_default_execute*()
|
||||
- cmdutils: fix typos
|
||||
- lavfi: fix typos
|
||||
- lavc: fix typos
|
||||
- tools: fix grammar error
|
||||
- avutil/mips/generic_macros_msa: rename macro variable which causes segfault for mips r6
|
||||
- videodsp: fix 1-byte overread in top/bottom READ_NUM_BYTES iterations.
|
||||
- avformat/avidec: Check nb_streams in read_gab2_sub()
|
||||
- avformat/avidec: Remove ancient assert
|
||||
- lavc/movtextdec.c: Avoid infinite loop on invalid data.
|
||||
- avcodec/ansi: Check dimensions
|
||||
- avcodec/cavsdsp: use av_clip_uint8() for idct
|
||||
|
||||
version 2.8.8
|
||||
- avformat/movenc: Check packet in mov_write_single_packet() too
|
||||
- avformat/movenc: Factor check_pkt() out
|
||||
- avformat/utils: fix timebase error in avformat_seek_file()
|
||||
- avcodec/g726: Add missing ADDB output mask
|
||||
- avcodec/avpacket: clear side_data_elems
|
||||
- avcodec/ccaption_dec: Use simple array instead of AVBuffer
|
||||
- swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices
|
||||
- swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices
|
||||
- avformat/avidec: Fix infinite loop in avi_read_nikon()
|
||||
- cmdutils: fix implicit declaration of SetDllDirectory function
|
||||
- cmdutils: check for SetDllDirectory() availability
|
||||
- avcodec/aacenc: Tighter input checks
|
||||
- libavcodec/wmalosslessdec: Check the remaining bits
|
||||
- avcodec/diracdec: Check numx/y
|
||||
- avcodec/indeo2: check ctab
|
||||
- avformat/swfdec: Fix inflate() error code check
|
||||
- avcodec/h264: Put context_count check back
|
||||
- cmdutils: remove the current working directory from the DLL search path on win32
|
||||
- avcodec/raw: Fix decoding of ilacetest.mov
|
||||
- avcodec/ffv1enc: Fix assertion failure with non zero bits per sample
|
||||
- avformat/oggdec: Fix integer overflow with invalid pts
|
||||
- ffplay: Fix invalid array index
|
||||
- avcodec/vp9_parser: Check the input frame sizes for being consistent
|
||||
- libavformat/rtpdec_asf: zero initialize the AVIOContext struct
|
||||
- libavutil/opt: Small bugfix in example.
|
||||
- libx264: Increase x264 opts character limit to 4096
|
||||
- avformat/mov: Check sample size
|
||||
- avformat/format: Fix registering a format more than once and related races
|
||||
- avcodec/flac_parser: Raise threshold for detecting invalid data
|
||||
- avfilter/vf_telecine: Make frame writable before writing into it
|
||||
- avcodec/mpc8: Correct end truncation
|
||||
- avcodec/mpegvideo: Do not clear the parse context during init
|
||||
- MAINTAINERs cleanup (remove myself from things i de facto do not maintain)
|
||||
- avcodec/h264: Fix off by 1 context count
|
||||
- avcodec/alsdec: Check r to prevent out of array read
|
||||
- avcodec/alsdec: fix max bits in ltp prefix code
|
||||
- avcodec/utils: check skip_samples signedness
|
||||
- avformat/mpegts: Do not trust BSSD descriptor, it is sometimes not an S302M stream
|
||||
- avcodec/bmp_parser: Check fsize
|
||||
- avcodec/bmp_parser: reset state
|
||||
- avcodec/bmp_parser: Fix remaining size
|
||||
- avcodec/bmp_parser: Fix frame_start_found in cross frame cases
|
||||
- avfilter/af_amix: do not fail if there are no samples in output_frame()
|
||||
- avformat/allformats: Making av_register_all() thread-safe.
|
||||
- avcodec/mpegvideo: Deallocate last/next picture earlier
|
||||
- avcodec/bmp_parser: Fix state
|
||||
- avformat/oggparseopus: Fix Undefined behavior in oggparseopus.c and libavformat/utils.c
|
||||
- doc/developer.texi: Add a code of conduct
|
||||
- avformat/avidec: Detect index with too short entries
|
||||
- avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()
|
||||
- avformat/utils: Do not compute the bitrate from duration == 0
|
||||
- ffmpeg: Check that r_frame_rate is set before attempting to use it
|
||||
- swresample/rematrix: Use clipping s16 rematrixing if overflows are possible
|
||||
- swresample/rematrix: Use error diffusion to avoid error in the DC component of the matrix
|
||||
- libavformat/oggdec: Free stream private when header parsing fails.
|
||||
- avformat/utils: Check bps before using it in a shift in ff_get_pcm_codec_id()
|
||||
- avformat/oggparseopus: Check that granule pos is within the supported range
|
||||
- avcodec/mjpegdec: Do not try to detect last scan but apply idct after all scans for progressive jpeg
|
||||
- avformat/options_table: Add missing identifier for very strict compliance
|
||||
- librtmp: Avoid an infiniloop setting connection arguments
|
||||
- avformat/oggparsevp8: fix pts calculation on pages ending with an invisible frame
|
||||
|
||||
|
||||
version 2.8.7
|
||||
- avcodec/motion_est: Attempt to fix "short data segment overflowed" on IA64
|
||||
- avformat/ffmdec: Check pix_fmt
|
||||
- avcodec/ttaenc: Reallocate packet if its too small
|
||||
- pgssubdec: fix subpicture output colorspace and range
|
||||
- avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
|
||||
- avfilter/vf_drawtext: Check return code of load_glyph()
|
||||
- avcodec/takdec: add code that got somehow lost in process of REing
|
||||
- avcodec/apedec: fix decoding of stereo files with one channel full of silence
|
||||
- avcodec/avpacket: Fix off by 5 error
|
||||
- avcodec/h264: Fix for H.264 configuration parsing
|
||||
- avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case
|
||||
- avfilter/src_movie: fix how we check for overflows with seek_point
|
||||
- avcodec/j2kenc: Add attribution to OpenJPEG project:
|
||||
- avcodec/h264_slice: Check PPS more extensively when its not copied
|
||||
- avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
|
||||
- avformat/rtpdec_jpeg: fix low contrast image on low quality setting
|
||||
- avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
|
||||
- lavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit is found.
|
||||
- avcodec/resample: Remove disabled and faulty code
|
||||
- indeo2: Fix banding artefacts
|
||||
- indeo2data: K&R formatting cosmetics
|
||||
- avcodec/imgconvert: Support non-planar colorspaces while padding
|
||||
- avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
|
||||
- avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing
|
||||
- avformat/concatdec: set safe mode to enabled instead of auto
|
||||
- avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay
|
||||
- avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
|
||||
- avformat/cache: Fix memleak of tree entries
|
||||
- lavf/mov: downgrade sidx errors to non-fatal warnings; fixes trac #5216 (cherry picked from commit 22dbc1caaf13e4bb17c9e0164a5b1ccaf490e428)
|
||||
- lavf/mov: fix sidx with edit lists (cherry picked from commit 3617e69d50dd9dd07b5011dfb9477a9d1a630354)
|
||||
- avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg
|
||||
- libwebpenc_animencoder: print library messages in verbose log levels
|
||||
- libwebpenc_animencoder: zero initialize the WebPAnimEncoderOptions struct
|
||||
- doc/utils: fix typo for min() description
|
||||
- avcodec/avpacket: clear priv in av_init_packet()
|
||||
- swscale/utils: Fix chrSrcHSubSample for GBRAP16
|
||||
- swscale/input: Fix GBRAP16 input
|
||||
- postproc: fix unaligned access
|
||||
- avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
|
||||
- avcodec/h264: Execute error concealment before marking the frame as done.
|
||||
- swscale/x86/output: Fix yuv2planeX_16* with unaligned destination
|
||||
- swscale/x86/output: Move code into yuv2planeX_mainloop
|
||||
- avutil/frame: Free destination qp_table_buf in frame_copy_props()
|
||||
|
||||
|
||||
version 2.8.6
|
||||
- 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/img2dec: Use AVOpenCallback
|
||||
- avformat/avio: Limit url option parsing to the documented cases
|
||||
- avformat/img2dec: do not interpret the filename by default if a IO context has been opened
|
||||
- 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
|
||||
- asfdec_o: check for too small size in asf_read_unknown
|
||||
- asfdec_o: break if EOF is reached after asf_read_packet_header
|
||||
- asfdec_o: make sure packet_size is non-zero before seeking
|
||||
- asfdec_o: prevent overflow causing seekback
|
||||
- asfdec_o: check avio_skip in asf_read_simple_index
|
||||
- asfdec_o: reject size > INT64_MAX in asf_read_unknown
|
||||
- asfdec_o: only set asf_pkt->data_size after sanity checks
|
||||
- Merge commit '8375dc1dd101d51baa430f34c0bcadfa37873896'
|
||||
- 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
|
||||
- avformat/brstm: fix overflow
|
||||
|
||||
|
||||
version 2.8.5
|
||||
- avformat/hls: Even stricter URL checks
|
||||
- avformat/hls: More strict url checks
|
||||
- avcodec/pngenc: Fix mixed up linesizes
|
||||
- avcodec/pngenc: Replace memcpy by av_image_copy()
|
||||
- swscale/vscale: Check that 2 tap filters are bilinear before using bilinear code
|
||||
- swscale: Move VScalerContext into vscale.c
|
||||
- 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/aacdec_template: Check id_map
|
||||
- avcodec/dvdec: Fix "left shift of negative value -254"
|
||||
- avcodec/g2meet: Check for ff_els_decode_bit() failure in epic_decode_run_length()
|
||||
- avcodec/mjpegdec: Fix negative shift
|
||||
- avcodec/mss2: Check for repeat overflow
|
||||
- avformat: Add integer fps from 31 to 60 to get_std_framerate()
|
||||
- avformat/ivfenc: fix division by zero
|
||||
- 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
|
||||
- avformat/mov: Update handbrake_version threshold for full mp3 parsing
|
||||
- x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
|
||||
- avfilter/vf_zoompan: do not free frame we pushed to lavfi
|
||||
- nuv: sanitize negative fps rate
|
||||
- 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
|
||||
|
||||
|
||||
version 2.8.4
|
||||
- rawdec: only exempt BIT0 with need_copy from buffer sanity check
|
||||
- mlvdec: check that index_entries exist
|
||||
- avcodec/mpeg4videodec: also for empty partitioned slices
|
||||
- avcodec/h264_refs: Fix long_idx check
|
||||
- avcodec/h264_mc_template: prefetch list1 only if it is used in the MB
|
||||
- avcodec/h264_slice: Simplify ref2frm indexing
|
||||
- avfilter/vf_mpdecimate: Add missing emms_c()
|
||||
- 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
|
||||
- golomb: always check for invalid UE golomb codes in get_ue_golomb
|
||||
- sbr_qmf_analysis: sanitize input for 32-bit imdct
|
||||
- sbrdsp_fixed: assert that input values are in the valid range
|
||||
- aacsbr: ensure strictly monotone time borders
|
||||
- aacenc: update max_sfb when num_swb changes
|
||||
- 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
|
||||
- avformat/mxfenc: Do not crash if there is no packet in the first stream
|
||||
- lavf/tee: fix side data double free.
|
||||
- avformat/hlsenc: Check the return code of avformat_write_header()
|
||||
- avformat/mov: Enable parser for mp3s by old HandBrake
|
||||
- avformat/mxfenc: Fix integer overflow in length computation
|
||||
- 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
|
||||
- mjpegdec: consider chroma subsampling in size check
|
||||
- libvpxenc: remove some unused ctrl id mappings
|
||||
- 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"
|
||||
- avformat/riffdec: Initialize bitrate
|
||||
- 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/h264_refs: Check that long references match before use
|
||||
- avcodec/utils: Clear dimensions in ff_get_buffer() on failure
|
||||
- avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()
|
||||
- avcodec/hevc: Check max ctb addresses for WPP
|
||||
- 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
|
||||
- lavf/rtpenc_jpeg: Less strict check for standard Huffman tables.
|
||||
- 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
|
||||
|
||||
|
||||
version 2.8.3
|
||||
- avcodec/cabac: Check initial cabac decoder state
|
||||
- avcodec/cabac_functions: Fix "left shift of negative value -31767"
|
||||
- avcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
|
||||
- rtmpcrypt: Do the xtea decryption in little endian mode
|
||||
- avformat/matroskadec: Check subtitle stream before dereferencing
|
||||
- avcodec/pngdec: Replace assert by request for sample for unsupported TRNS cases
|
||||
- avformat/utils: Do not init parser if probing is unfinished
|
||||
- avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
|
||||
- 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
|
||||
- aacsbr: don't call sbr_dequant twice without intermediate read_sbr_data
|
||||
- hqx: correct type and size check of info_offset
|
||||
- mxfdec: check edit_rate also for physical_track
|
||||
- avcodec/jpeg2000: Change coord to 32bit to support larger than 32k width or height
|
||||
- avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range
|
||||
- avcodec/jpeg2000: Check comp coords to be within the supported size
|
||||
- mpegvideo: clear overread in clear_context
|
||||
- avcodec/avrndec: Use the AVFrame format instead of the context
|
||||
- dds: disable palette flag for compressed images
|
||||
- dds: validate compressed source buffer size
|
||||
- dds: validate source buffer size before copying
|
||||
- dvdsubdec: validate offset2 similar to offset1
|
||||
- brstm: reject negative sample rate
|
||||
- aacps: avoid division by zero in stereo_processing
|
||||
- softfloat: assert when the argument of av_sqrt_sf is negative
|
||||
|
||||
version 2.8.2
|
||||
- various fixes in the aac_fixed decoder
|
||||
- various fixes in softfloat
|
||||
- swresample/resample: increase precision for compensation
|
||||
- lavf/mov: add support for sidx fragment indexes
|
||||
- avformat/mxfenc: Only store user comment related tags when needed
|
||||
- tests/fate/avformat: Fix fate-lavf
|
||||
- doc/ffmpeg: Clarify that the sdp_file option requires an rtp output.
|
||||
- ffmpeg: Don't try and write sdp info if none of the outputs had an rtp format.
|
||||
- apng: use correct size for output buffer
|
||||
- jvdec: avoid unsigned overflow in comparison
|
||||
- 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
|
||||
- avcodec/mpeg12dec: Do not call show_bits() with invalid bits
|
||||
- avcodec/faxcompr: Add missing runs check in decode_uncompressed()
|
||||
- libavutil/channel_layout: Check strtol*() for failure
|
||||
- avformat/mpegts: Only start probing data streams within probe_packets
|
||||
- avcodec/hevc_ps: Check chroma_format_idc
|
||||
- avcodec/ffv1dec: Check for 0 quant tables
|
||||
- avcodec/mjpegdec: Reinitialize IDCT on BPP changes
|
||||
- avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
|
||||
- avutil/file_open: avoid file handle inheritance on Windows
|
||||
- avcodec/h264_slice: Disable slice threads if there are multiple access units in a packet
|
||||
- avformat/hls: update cookies on setcookie response
|
||||
- opusdec: Don't run vector_fmul_scalar on zero length arrays
|
||||
- avcodec/opusdec: Fix extra samples read index
|
||||
- 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
|
||||
- rtsp: Allow $ as interleaved packet indicator before a complete response header
|
||||
- videodsp: don't overread edges in vfix3 emu_edge.
|
||||
- avformat/mp3dec: improve junk skipping heuristic
|
||||
- concatdec: fix file_start_time calculation regression
|
||||
- avcodec: loongson optimize h264dsp idct and loop filter with mmi
|
||||
- avcodec/jpeg2000dec: Clear properties in jpeg2000_dec_cleanup() too
|
||||
- avformat/hls: add support for EXT-X-MAP
|
||||
- avformat/hls: fix segment selection regression on track changes of live streams
|
||||
- configure: Require libkvazaar < 0.7.
|
||||
- avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
|
||||
|
||||
|
||||
version 2.8.1:
|
||||
- swscale: fix ticket #4881
|
||||
- doc: fix spelling errors
|
||||
- hls: only seek if there is an offset
|
||||
- asfdec: add more checks for size left in asf packet buffer
|
||||
- asfdec: alloc enough space for storing name in asf_read_metadata_obj
|
||||
- avcodec/pngdec: Check blend_op.
|
||||
- h264_mp4toannexb: fix pps offfset fault when there are more than one sps in avcc
|
||||
- avcodec/h264_mp4toannexb_bsf: Use av_freep() to free spspps_buf
|
||||
- avformat/avidec: Workaround broken initial frame
|
||||
- avformat/hls: fix some cases of HLS streams which require cookies
|
||||
- avcodec/pngdec: reset has_trns after every decode_frame_png()
|
||||
- lavf/img2dec: Fix memory leak
|
||||
- avcodec/mp3: fix skipping zeros
|
||||
- avformat/srtdec: make sure we probe a number
|
||||
- configure: check for ID3D11VideoContext
|
||||
- avformat/vobsub: compare correct packet stream IDs
|
||||
- avformat/srtdec: more lenient first line probing
|
||||
- avformat/srtdec: fix number check for the first character
|
||||
- avcodec/mips: build fix for MSA 64bit
|
||||
- avcodec/mips: build fix for MSA
|
||||
- avformat/httpauth: Add space after commas in HTTP/RTSP auth header
|
||||
- libavformat/hlsenc: Use of uninitialized memory unlinking old files
|
||||
- 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
|
||||
- dnxhddata: correct weight tables
|
||||
- dnxhddec: decode and use interlace mb flag
|
||||
- swscale: fix ticket #4877
|
||||
- avcodec/rangecoder: Check e
|
||||
- avcodec/ffv1: separate slice_count from max_slice_count
|
||||
- swscale: fix ticket 4850
|
||||
- cmdutils: Filter dst/srcw/h
|
||||
- avutil/log: fix zero length gnu_printf format string warning
|
||||
- lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
|
||||
- swscale/swscale: Fix "unused variable" warning
|
||||
- avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
|
||||
- MAINTAINERS: add 2.8, drop 2.2
|
||||
- doc: mention libavcodec can decode Opus natively
|
||||
- hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
|
||||
- avfilter/af_ladspa: process all channels for nb_handles > 1
|
||||
- configure: add libsoxr to swresample's pkgconfig
|
||||
- lavc: Fix compilation with --disable-everything --enable-parser=mpeg4video.
|
||||
|
||||
version 2.8:
|
||||
version <next>:
|
||||
- colorkey video filter
|
||||
- BFSTM/BCSTM demuxer
|
||||
- little-endian ADPCM_THP decoder
|
||||
|
||||
+6
-6
@@ -56,7 +56,7 @@ Communication
|
||||
website Deby Barbara Lepage
|
||||
fate.ffmpeg.org Timothy Gu
|
||||
Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos, Lou Logan
|
||||
mailing lists Baptiste Coudurier, Lou Logan
|
||||
mailing lists Michael Niedermayer, Baptiste Coudurier, Lou Logan
|
||||
Google+ Paul B Mahol, Michael Niedermayer, Alexander Strasser
|
||||
Twitter Lou Logan, Reynaldo H. Verdejo Pinochet
|
||||
Launchpad Timothy Gu
|
||||
@@ -166,7 +166,7 @@ Codecs:
|
||||
dca.c Kostya Shishkov, Benjamin Larsson
|
||||
dnxhd* Baptiste Coudurier
|
||||
dpcm.c Mike Melanson
|
||||
dss_sp.c Oleksij Rempel
|
||||
dss_sp.c Oleksij Rempel, Michael Niedermayer
|
||||
dv.c Roman Shaposhnik
|
||||
dvbsubdec.c Anshul Maheshwari
|
||||
dxa.c Kostya Shishkov
|
||||
@@ -419,7 +419,7 @@ Muxers/Demuxers:
|
||||
cdxl.c Paul B Mahol
|
||||
crc.c Michael Niedermayer
|
||||
daud.c Reimar Doeffinger
|
||||
dss.c Oleksij Rempel
|
||||
dss.c Oleksij Rempel, Michael Niedermayer
|
||||
dtshddec.c Paul B Mahol
|
||||
dv.c Roman Shaposhnik
|
||||
dxa.c Kostya Shishkov
|
||||
@@ -455,7 +455,7 @@ Muxers/Demuxers:
|
||||
mgsts.c Paul B Mahol
|
||||
microdvd* Aurelien Jacobs
|
||||
mm.c Peter Ross
|
||||
mov.c Baptiste Coudurier
|
||||
mov.c Michael Niedermayer, Baptiste Coudurier
|
||||
movenc.c Baptiste Coudurier, Matthieu Bouron
|
||||
mpc.c Kostya Shishkov
|
||||
mpeg.c Michael Niedermayer
|
||||
@@ -558,17 +558,17 @@ Windows MSVC Matthew Oliver, Hendrik Leppkes
|
||||
Windows ICL Matthew Oliver
|
||||
ADI/Blackfin DSP Marc Hoffman
|
||||
Sparc Roman Shaposhnik
|
||||
OS/2 KO Myung-Hun
|
||||
x86 Michael Niedermayer
|
||||
|
||||
|
||||
Releases
|
||||
========
|
||||
|
||||
2.8 Michael Niedermayer
|
||||
2.7 Michael Niedermayer
|
||||
2.6 Michael Niedermayer
|
||||
2.5 Michael Niedermayer
|
||||
2.4 Michael Niedermayer
|
||||
2.2 Michael Niedermayer
|
||||
|
||||
If you want to maintain an older release, please contact us
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
┌────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 2.8 "Feynman" │
|
||||
└────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 2.8 "Feynman", about 3
|
||||
months after the release of FFmpeg 2.7.
|
||||
|
||||
A complete Changelog is available at the root of the project, and the
|
||||
complete Git history on http://source.ffmpeg.org.
|
||||
|
||||
We hope you will like this release as much as we enjoyed working on it, and
|
||||
as usual, if you have any questions about it, or any FFmpeg related topic,
|
||||
feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
|
||||
on the mailing-lists.
|
||||
+2
-20
@@ -60,9 +60,6 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#endif
|
||||
#if HAVE_SETDLLDIRECTORY
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
static int init_report(const char *env);
|
||||
|
||||
@@ -109,15 +106,6 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v
|
||||
}
|
||||
}
|
||||
|
||||
void init_dynload(void)
|
||||
{
|
||||
#if HAVE_SETDLLDIRECTORY
|
||||
/* Calling SetDllDirectory with the empty string (but not NULL) removes the
|
||||
* current working directory from the DLL search path as a security pre-caution. */
|
||||
SetDllDirectory("");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void (*program_exit)(int ret);
|
||||
|
||||
void register_exit(void (*cb)(int ret))
|
||||
@@ -575,12 +563,6 @@ int opt_default(void *optctx, const char *opt, const char *arg)
|
||||
struct SwsContext *sws = sws_alloc_context();
|
||||
int ret = av_opt_set(sws, opt, arg, 0);
|
||||
sws_freeContext(sws);
|
||||
if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") ||
|
||||
!strcmp(opt, "dstw") || !strcmp(opt, "dsth") ||
|
||||
!strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (ret < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
|
||||
return ret;
|
||||
@@ -2075,7 +2057,7 @@ static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
|
||||
if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category))
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
printf("Auto-detected sources for %s:\n", fmt->name);
|
||||
printf("Audo-detected sources for %s:\n", fmt->name);
|
||||
if (!fmt->get_device_list) {
|
||||
ret = AVERROR(ENOSYS);
|
||||
printf("Cannot list sources. Not implemented.\n");
|
||||
@@ -2105,7 +2087,7 @@ static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
|
||||
if (!fmt || !fmt->priv_class || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category))
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
printf("Auto-detected sinks for %s:\n", fmt->name);
|
||||
printf("Audo-detected sinks for %s:\n", fmt->name);
|
||||
if (!fmt->get_device_list) {
|
||||
ret = AVERROR(ENOSYS);
|
||||
printf("Cannot list sinks. Not implemented.\n");
|
||||
|
||||
+2
-7
@@ -61,11 +61,6 @@ void register_exit(void (*cb)(int ret));
|
||||
*/
|
||||
void exit_program(int ret) av_noreturn;
|
||||
|
||||
/**
|
||||
* Initialize dynamic library loading
|
||||
*/
|
||||
void init_dynload(void);
|
||||
|
||||
/**
|
||||
* Initialize the cmdutils option system, in particular
|
||||
* allocate the *_opts contexts.
|
||||
@@ -450,13 +445,13 @@ int show_devices(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
#if CONFIG_AVDEVICE
|
||||
/**
|
||||
* Print a listing containing autodetected sinks of the output device.
|
||||
* 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 autodetected sources of the input device.
|
||||
* 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);
|
||||
|
||||
@@ -1797,7 +1797,6 @@ SYSTEM_FUNCS="
|
||||
sched_getaffinity
|
||||
SetConsoleTextAttribute
|
||||
SetConsoleCtrlHandler
|
||||
SetDllDirectory
|
||||
setmode
|
||||
setrlimit
|
||||
Sleep
|
||||
@@ -2375,7 +2374,7 @@ zmbv_encoder_select="zlib"
|
||||
|
||||
# hardware accelerators
|
||||
crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
|
||||
d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder ID3D11VideoContext"
|
||||
d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
|
||||
dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
|
||||
vaapi_deps="va_va_h"
|
||||
vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads CoreServices_CoreServices_h"
|
||||
@@ -5103,7 +5102,6 @@ check_func_headers windows.h MapViewOfFile
|
||||
check_func_headers windows.h PeekNamedPipe
|
||||
check_func_headers windows.h SetConsoleTextAttribute
|
||||
check_func_headers windows.h SetConsoleCtrlHandler
|
||||
check_func_headers windows.h SetDllDirectory
|
||||
check_func_headers windows.h Sleep
|
||||
check_func_headers windows.h VirtualAlloc
|
||||
check_struct windows.h "CONDITION_VARIABLE" Ptr
|
||||
@@ -5149,7 +5147,6 @@ check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
|
||||
|
||||
check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
|
||||
check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
|
||||
check_type "windows.h d3d11.h" "ID3D11VideoContext"
|
||||
check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
|
||||
|
||||
check_type "va/va.h" "VAPictureParameterBufferHEVC"
|
||||
@@ -5242,7 +5239,7 @@ enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
|
||||
check_lib "${gsm_hdr}" gsm_create -lgsm && break;
|
||||
done || die "ERROR: libgsm not found"; }
|
||||
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
|
||||
enabled libkvazaar && require_pkg_config "kvazaar < 0.7.0" kvazaar.h kvz_api_get
|
||||
enabled libkvazaar && require_pkg_config kvazaar kvazaar.h kvz_api_get
|
||||
enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
|
||||
enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
|
||||
enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
|
||||
@@ -5264,7 +5261,7 @@ enabled libshine && require_pkg_config shine shine/layer3.h shine_encod
|
||||
enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
|
||||
require smbclient libsmbclient.h smbc_init -lsmbclient; }
|
||||
enabled libsnappy && require snappy snappy-c.h snappy_compress -lsnappy
|
||||
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr && LIBSOXR="-lsoxr"
|
||||
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
|
||||
enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
|
||||
enabled libspeex && require_pkg_config speex speex/speex.h speex_decoder_init -lspeex
|
||||
enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
|
||||
@@ -5737,7 +5734,6 @@ __declspec($_restrict) void* foo(int);
|
||||
EOF
|
||||
fi
|
||||
check_func strtoll || add_cflags -Dstrtoll=_strtoi64
|
||||
check_func strtoull || add_cflags -Dstrtoull=_strtoui64
|
||||
fi
|
||||
|
||||
for pfx in "" host_; do
|
||||
@@ -6144,7 +6140,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 2017
|
||||
#define CONFIG_THIS_YEAR 2015
|
||||
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
|
||||
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
|
||||
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
|
||||
@@ -6268,4 +6264,4 @@ pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVF
|
||||
pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
|
||||
pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$LIBM"
|
||||
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
|
||||
pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM $LIBSOXR"
|
||||
pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"
|
||||
|
||||
+11
-13
@@ -15,29 +15,27 @@ libavutil: 2014-08-09
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
-------- 8< --------- FFmpeg 2.8 was cut here -------- 8< ---------
|
||||
|
||||
2015-08-27 - 1dd854e1 - lavc 56.58.100 - vaapi.h
|
||||
2015-xx-xx - lavc 56.58.100 - vaapi.h
|
||||
Deprecate old VA-API context (vaapi_context) fields that were only
|
||||
set and used by libavcodec. They are all managed internally now.
|
||||
|
||||
2015-08-19 - 9f8e57ef - lavu 54.31.100 - pixfmt.h
|
||||
2015-xx-xx - lavu 54.31.100 - pixfmt.h
|
||||
Add a unique pixel format for VA-API (AV_PIX_FMT_VAAPI) that
|
||||
indicates the nature of the underlying storage: a VA surface. This
|
||||
yields the same value as AV_PIX_FMT_VAAPI_VLD.
|
||||
Deprecate old VA-API related pixel formats: AV_PIX_FMT_VAAPI_MOCO,
|
||||
AV_PIX_FMT_VAAPI_IDCT, AV_PIX_FMT_VAAPI_VLD.
|
||||
|
||||
2015-08-02 - lavu 54.30.100 / 54.17.0
|
||||
9ed59f1 / 7a7df34c - Add av_blowfish_alloc().
|
||||
a130ec9 / ae365453 - Add av_rc4_alloc().
|
||||
9ca1997 / 5d8bea3b - Add av_xtea_alloc().
|
||||
3cf08e9 / d9e8b47e - Add av_des_alloc().
|
||||
2015-xx-xx - lavu 54.30.0
|
||||
xxxxxxx - Add av_blowfish_alloc().
|
||||
xxxxxxx - Add av_rc4_alloc().
|
||||
xxxxxxx - Add av_xtea_alloc().
|
||||
xxxxxxx - Add av_des_alloc().
|
||||
|
||||
2015-07-27 - lavc 56.56.100 / 56.35.0 - avcodec.h
|
||||
94d68a4 / 7c6eb0a1 - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
|
||||
444e987 / def97856 - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
|
||||
29d147c / 059a9348 - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE
|
||||
2015-xx-xx - lavc 56.35.0 - avcodec.h
|
||||
xxxxxxxxx - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
|
||||
xxxxxxxxx - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
|
||||
xxxxxxxxx - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE
|
||||
to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE.
|
||||
|
||||
2015-07-22 - c40ecff - lavc 56.51.100 - avcodec.h
|
||||
|
||||
+1
-1
@@ -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.8.12
|
||||
PROJECT_NUMBER =
|
||||
|
||||
# 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
|
||||
|
||||
+2
-21
@@ -104,7 +104,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
|
||||
@@ -192,9 +192,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
|
||||
@@ -418,23 +416,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.
|
||||
|
||||
@@ -400,35 +400,6 @@ finding a new maintainer and also don't forget updating the @file{MAINTAINERS} f
|
||||
|
||||
We think our rules are not too hard. If you have comments, contact us.
|
||||
|
||||
@section Code of conduct
|
||||
|
||||
Be friendly and respectful towards others and third parties.
|
||||
Treat others the way you yourself want to be treated.
|
||||
|
||||
Be considerate. Not everyone shares the same viewpoint and priorities as you do.
|
||||
Different opinions and interpretations help the project.
|
||||
Looking at issues from a different perspective assists development.
|
||||
|
||||
Do not assume malice for things that can be attributed to incompetence. Even if
|
||||
it is malice, it's rarely good to start with that as initial assumption.
|
||||
|
||||
Stay friendly even if someone acts contrarily. Everyone has a bad day
|
||||
once in a while.
|
||||
If you yourself have a bad day or are angry then try to take a break and reply
|
||||
once you are calm and without anger if you have to.
|
||||
|
||||
Try to help other team members and cooperate if you can.
|
||||
|
||||
The goal of software development is to create technical excellence, not for any
|
||||
individual to be better and "win" against the others. Large software projects
|
||||
are only possible and successful through teamwork.
|
||||
|
||||
If someone struggles do not put them down. Give them a helping hand
|
||||
instead and point them in the right direction.
|
||||
|
||||
Finally, keep in mind the immortal words of Bill and Ted,
|
||||
"Be excellent to each other."
|
||||
|
||||
@anchor{Submitting patches}
|
||||
@section Submitting patches
|
||||
|
||||
|
||||
+1
-1
@@ -1353,7 +1353,7 @@ can be selected with @code{-pred 1}.
|
||||
@table @option
|
||||
@item format
|
||||
Can be set to either @code{j2k} or @code{jp2} (the default) that
|
||||
makes it possible to store non-rgb pix_fmts.
|
||||
allows to store non-rgb pix_fmts.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
+11
-11
@@ -12,7 +12,7 @@
|
||||
|
||||
@chapter Synopsis
|
||||
|
||||
ffmpeg [@var{global_options}] @{[@var{input_file_options}] -i @file{input_url}@} ... @{[@var{output_file_options}] @file{output_url}@} ...
|
||||
ffmpeg [@var{global_options}] @{[@var{input_file_options}] -i @file{input_file}@} ... @{[@var{output_file_options}] @file{output_file}@} ...
|
||||
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
@@ -24,10 +24,10 @@ rates and resize video on the fly with a high quality polyphase filter.
|
||||
@command{ffmpeg} reads from an arbitrary number of input "files" (which can be regular
|
||||
files, pipes, network streams, grabbing devices, etc.), specified by the
|
||||
@code{-i} option, and writes to an arbitrary number of output "files", which are
|
||||
specified by a plain output url. Anything found on the command line which
|
||||
cannot be interpreted as an option is considered to be an output url.
|
||||
specified by a plain output filename. Anything found on the command line which
|
||||
cannot be interpreted as an option is considered to be an output filename.
|
||||
|
||||
Each input or output url can, in principle, contain any number of streams of
|
||||
Each input or output file can, in principle, contain any number of streams of
|
||||
different types (video/audio/subtitle/attachment/data). The allowed number and/or
|
||||
types of streams may be limited by the container format. Selecting which
|
||||
streams from which inputs will go into which output is either done automatically
|
||||
@@ -243,8 +243,8 @@ Force input or output file format. The format is normally auto detected for inpu
|
||||
files and guessed from the file extension for output files, so this option is not
|
||||
needed in most cases.
|
||||
|
||||
@item -i @var{url} (@emph{input})
|
||||
input file url
|
||||
@item -i @var{filename} (@emph{input})
|
||||
input file name
|
||||
|
||||
@item -y (@emph{global})
|
||||
Overwrite output files without asking.
|
||||
@@ -277,7 +277,7 @@ libx264, and the 138th audio, which will be encoded with libvorbis.
|
||||
When used as an input option (before @code{-i}), limit the @var{duration} of
|
||||
data read from the input file.
|
||||
|
||||
When used as an output option (before an output url), stop writing the
|
||||
When used as an output option (before an output filename), stop writing the
|
||||
output after its duration reaches @var{duration}.
|
||||
|
||||
@var{duration} must be a time duration specification,
|
||||
@@ -304,7 +304,7 @@ extra segment between the seek point and @var{position} will be decoded and
|
||||
discarded. When doing stream copy or when @option{-noaccurate_seek} is used, it
|
||||
will be preserved.
|
||||
|
||||
When used as an output option (before an output url), decodes but discards
|
||||
When used as an output option (before an output filename), decodes but discards
|
||||
input until the timestamps reach @var{position}.
|
||||
|
||||
@var{position} must be a time duration specification,
|
||||
@@ -1094,7 +1094,7 @@ may be reassigned to a different value.
|
||||
For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
|
||||
an output mpegts file:
|
||||
@example
|
||||
ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
|
||||
ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
|
||||
@end example
|
||||
|
||||
@item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream})
|
||||
@@ -1205,9 +1205,9 @@ The option is intended for cases where features are needed that cannot be
|
||||
specified to @command{ffserver} but can be to @command{ffmpeg}.
|
||||
|
||||
@item -sdp_file @var{file} (@emph{global})
|
||||
Print sdp information for an output stream to @var{file}.
|
||||
Print sdp information to @var{file}.
|
||||
This allows dumping sdp information when at least one output isn't an
|
||||
rtp stream. (Requires at least one of the output formats to be rtp).
|
||||
rtp stream.
|
||||
|
||||
@item -discard (@emph{input})
|
||||
Allows discarding specific streams or frames of streams at the demuxer.
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@
|
||||
|
||||
@chapter Synopsis
|
||||
|
||||
ffplay [@var{options}] [@file{input_url}]
|
||||
ffplay [@var{options}] [@file{input_file}]
|
||||
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
@@ -106,8 +106,8 @@ the input audio.
|
||||
Use the option "-filters" to show all the available filters (including
|
||||
sources and sinks).
|
||||
|
||||
@item -i @var{input_url}
|
||||
Read @var{input_url}.
|
||||
@item -i @var{input_file}
|
||||
Read @var{input_file}.
|
||||
@end table
|
||||
|
||||
@section Advanced options
|
||||
|
||||
+5
-5
@@ -12,7 +12,7 @@
|
||||
|
||||
@chapter Synopsis
|
||||
|
||||
ffprobe [@var{options}] [@file{input_url}]
|
||||
ffprobe [@var{options}] [@file{input_file}]
|
||||
|
||||
@chapter Description
|
||||
@c man begin DESCRIPTION
|
||||
@@ -24,8 +24,8 @@ For example it can be used to check the format of the container used
|
||||
by a multimedia stream and the format and type of each media stream
|
||||
contained in it.
|
||||
|
||||
If a url is specified in input, ffprobe will try to open and
|
||||
probe the url content. If the url cannot be opened or recognized as
|
||||
If a filename is specified in input, ffprobe will try to open and
|
||||
probe the file content. If the file cannot be opened or recognized as
|
||||
a multimedia file, a positive exit code is returned.
|
||||
|
||||
ffprobe may be employed both as a standalone application or in
|
||||
@@ -332,8 +332,8 @@ with name "PIXEL_FORMAT".
|
||||
Force bitexact output, useful to produce output which is not dependent
|
||||
on the specific build.
|
||||
|
||||
@item -i @var{input_url}
|
||||
Read @var{input_url}.
|
||||
@item -i @var{input_file}
|
||||
Read @var{input_file}.
|
||||
|
||||
@end table
|
||||
@c man end
|
||||
|
||||
+9
-9
@@ -1032,7 +1032,7 @@ Number_of_samples
|
||||
For example full key look like this @code{lavfi.astats.1.DC_offset} or
|
||||
this @code{lavfi.astats.Overall.Peak_count}.
|
||||
|
||||
For description what each key means read below.
|
||||
For description what each key means read bellow.
|
||||
|
||||
@item reset
|
||||
Set number of frame after which stats are going to be recalculated.
|
||||
@@ -2199,7 +2199,7 @@ Amount of milliseconds the signal has to rise above the threshold before gain
|
||||
reduction starts. Default is 20. Range is between 0.01 and 2000.
|
||||
|
||||
@item release
|
||||
Amount of milliseconds the signal has to fall below the threshold before
|
||||
Amount of milliseconds the signal has to fall bellow the threshold before
|
||||
reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
|
||||
|
||||
@item makeup
|
||||
@@ -4118,7 +4118,7 @@ It accepts the following options:
|
||||
@item threshold1
|
||||
@item threshold2
|
||||
@item threshold3
|
||||
Limit the maximum change for each plane, default is 65535.
|
||||
Allows to limit the maximum change for each plane, default is 65535.
|
||||
If 0, plane will remain unchanged.
|
||||
@end table
|
||||
|
||||
@@ -4321,7 +4321,7 @@ It accepts the following options:
|
||||
@item threshold1
|
||||
@item threshold2
|
||||
@item threshold3
|
||||
Limit the maximum change for each plane, default is 65535.
|
||||
Allows to limit the maximum change for each plane, default is 65535.
|
||||
If 0, plane will remain unchanged.
|
||||
|
||||
@item coordinates
|
||||
@@ -4967,7 +4967,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
|
||||
@@ -5206,7 +5206,7 @@ It accepts the following options:
|
||||
@item threshold1
|
||||
@item threshold2
|
||||
@item threshold3
|
||||
Limit the maximum change for each plane, default is 65535.
|
||||
Allows to limit the maximum change for each plane, default is 65535.
|
||||
If 0, plane will remain unchanged.
|
||||
|
||||
@item coordinates
|
||||
@@ -6900,7 +6900,7 @@ It accepts the following options:
|
||||
@item threshold1
|
||||
@item threshold2
|
||||
@item threshold3
|
||||
Limit the maximum change for each plane, default is 65535.
|
||||
Allows to limit the maximum change for each plane, default is 65535.
|
||||
If 0, plane will remain unchanged.
|
||||
@end table
|
||||
|
||||
@@ -9206,7 +9206,7 @@ uses the reference video instead of the main input as basis.
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Scale a subtitle stream (b) to match the main video (a) in size before overlaying
|
||||
Scale a subtitle stream to match the main video in size before overlaying
|
||||
@example
|
||||
'scale2ref[b][a];[a][b]overlay'
|
||||
@end example
|
||||
@@ -9881,7 +9881,7 @@ stereo3d=sbsl:aybd
|
||||
@end example
|
||||
|
||||
@item
|
||||
Convert input video from above below (left eye above, right eye below) to side by side crosseye.
|
||||
Convert input video from above bellow (left eye above, right eye below) to side by side crosseye.
|
||||
@example
|
||||
stereo3d=abl:sbsr
|
||||
@end example
|
||||
|
||||
@@ -205,10 +205,6 @@ For example to separate the fields with newlines and indention:
|
||||
ffprobe -dump_separator "
|
||||
" -i ~/videos/matrixbench_mpeg2.mpg
|
||||
@end example
|
||||
|
||||
@item max_streams @var{integer} (@emph{input})
|
||||
Specifies the maximum number of streams. This can be used to reject files that
|
||||
would require too many resources due to a large number of streams.
|
||||
@end table
|
||||
|
||||
@c man end FORMAT OPTIONS
|
||||
|
||||
+2
-2
@@ -983,8 +983,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
|
||||
|
||||
@@ -839,21 +839,6 @@ ffmpeg -i file.mpg -c copy \
|
||||
-y out.ts
|
||||
@end example
|
||||
|
||||
@section mxf, mxf_d10
|
||||
|
||||
MXF muxer.
|
||||
|
||||
@subsection Options
|
||||
|
||||
The muxer options are:
|
||||
|
||||
@table @option
|
||||
@item store_user_comments @var{bool}
|
||||
Set if user comments should be stored if available or never.
|
||||
IRT D-10 does not allow user comments. The default is thus to write them for
|
||||
mxf but not for mxf_d10
|
||||
@end table
|
||||
|
||||
@section null
|
||||
|
||||
Null muxer.
|
||||
|
||||
+1
-1
@@ -869,7 +869,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}.
|
||||
|
||||
@@ -2447,9 +2447,6 @@ static void print_sdp(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (!j)
|
||||
goto fail;
|
||||
|
||||
av_sdp_create(avc, j, sdp, sizeof(sdp));
|
||||
|
||||
if (!sdp_filename) {
|
||||
@@ -2465,7 +2462,6 @@ static void print_sdp(void)
|
||||
}
|
||||
}
|
||||
|
||||
fail:
|
||||
av_freep(&avc);
|
||||
}
|
||||
|
||||
@@ -2882,8 +2878,7 @@ static int transcode_init(void)
|
||||
* overhead
|
||||
*/
|
||||
if(!strcmp(oc->oformat->name, "avi")) {
|
||||
if ( copy_tb<0 && ist->st->r_frame_rate.num
|
||||
&& av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
|
||||
if ( copy_tb<0 && av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
|
||||
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(ist->st->time_base)
|
||||
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(dec_ctx->time_base)
|
||||
&& av_q2d(ist->st->time_base) < 1.0/500 && av_q2d(dec_ctx->time_base) < 1.0/500
|
||||
@@ -4118,8 +4113,6 @@ int main(int argc, char **argv)
|
||||
int ret;
|
||||
int64_t ti;
|
||||
|
||||
init_dynload();
|
||||
|
||||
register_exit(ffmpeg_cleanup);
|
||||
|
||||
setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */
|
||||
|
||||
+2
-2
@@ -2883,8 +2883,8 @@ enum OptGroup {
|
||||
};
|
||||
|
||||
static const OptionGroupDef groups[] = {
|
||||
[GROUP_OUTFILE] = { "output url", NULL, OPT_OUTPUT },
|
||||
[GROUP_INFILE] = { "input url", "i", OPT_INPUT },
|
||||
[GROUP_OUTFILE] = { "output file", NULL, OPT_OUTPUT },
|
||||
[GROUP_INFILE] = { "input file", "i", OPT_INPUT },
|
||||
};
|
||||
|
||||
static int open_files(OptionGroupList *l, const char *inout,
|
||||
|
||||
@@ -2869,7 +2869,7 @@ static int read_thread(void *arg)
|
||||
AVStream *st = ic->streams[i];
|
||||
enum AVMediaType type = st->codec->codec_type;
|
||||
st->discard = AVDISCARD_ALL;
|
||||
if (type >= 0 && wanted_stream_spec[type] && st_index[type] == -1)
|
||||
if (wanted_stream_spec[type] && st_index[type] == -1)
|
||||
if (avformat_match_stream_specifier(ic, st, wanted_stream_spec[type]) > 0)
|
||||
st_index[type] = i;
|
||||
}
|
||||
@@ -3684,8 +3684,6 @@ int main(int argc, char **argv)
|
||||
VideoState *is;
|
||||
char dummy_videodriver[] = "SDL_VIDEODRIVER=dummy";
|
||||
|
||||
init_dynload();
|
||||
|
||||
av_log_set_flags(AV_LOG_SKIP_REPEATED);
|
||||
parse_loglevel(argc, argv, options);
|
||||
|
||||
|
||||
@@ -3142,8 +3142,6 @@ int main(int argc, char **argv)
|
||||
char *w_name = NULL, *w_args = NULL;
|
||||
int ret, i;
|
||||
|
||||
init_dynload();
|
||||
|
||||
av_log_set_flags(AV_LOG_SKIP_REPEATED);
|
||||
register_exit(ffprobe_cleanup);
|
||||
|
||||
|
||||
+1
-6
@@ -2580,10 +2580,8 @@ static int http_receive_data(HTTPContext *c)
|
||||
} else if (c->buffer_ptr - c->buffer >= 2 &&
|
||||
!memcmp(c->buffer_ptr - 1, "\r\n", 2)) {
|
||||
c->chunk_size = strtol(c->buffer, 0, 16);
|
||||
if (c->chunk_size <= 0) { // end of stream or invalid chunk size
|
||||
c->chunk_size = 0;
|
||||
if (c->chunk_size == 0) // end of stream
|
||||
goto fail;
|
||||
}
|
||||
c->buffer_ptr = c->buffer;
|
||||
break;
|
||||
} else if (++loop_run > 10)
|
||||
@@ -2605,7 +2603,6 @@ static int http_receive_data(HTTPContext *c)
|
||||
/* end of connection : close it */
|
||||
goto fail;
|
||||
else {
|
||||
av_assert0(len <= c->chunk_size);
|
||||
c->chunk_size -= len;
|
||||
c->buffer_ptr += len;
|
||||
c->data_count += len;
|
||||
@@ -3820,8 +3817,6 @@ int main(int argc, char **argv)
|
||||
struct sigaction sigact = { { 0 } };
|
||||
int ret = 0;
|
||||
|
||||
init_dynload();
|
||||
|
||||
config.filename = av_strdup("/etc/ffserver.conf");
|
||||
|
||||
parse_loglevel(argc, argv, options);
|
||||
|
||||
+2
-5
@@ -120,15 +120,12 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
if (avctx->bits_per_coded_sample <= 8) {
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt,
|
||||
AV_PKT_DATA_PALETTE,
|
||||
&size);
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
NULL);
|
||||
if (pal) {
|
||||
frame->palette_has_changed = 1;
|
||||
memcpy(c->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
|
||||
memcpy (frame->data[1], c->pal, AVPALETTE_SIZE);
|
||||
|
||||
+1
-1
@@ -861,7 +861,7 @@ OBJS-$(CONFIG_MJPEG_PARSER) += mjpeg_parser.o
|
||||
OBJS-$(CONFIG_MLP_PARSER) += mlp_parser.o mlp.o
|
||||
OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \
|
||||
mpeg4videodec.o mpeg4video.o \
|
||||
ituh263dec.o h263dec.o h263data.o
|
||||
ituh263dec.o h263dec.o
|
||||
OBJS-$(CONFIG_PNG_PARSER) += png_parser.o
|
||||
OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o \
|
||||
mpegaudiodecheader.o mpegaudiodata.o
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#define Q30(x) (int)((x)*1073741824.0 + 0.5)
|
||||
#define Q31(x) (int)((x)*2147483648.0 + 0.5)
|
||||
#define RANGE15(x) x
|
||||
#define GET_GAIN(x, y) (-(y) * (1 << (x))) + 1024
|
||||
#define GET_GAIN(x, y) (-(y) << (x)) + 1024
|
||||
#define AAC_MUL16(x, y) (int)(((int64_t)(x) * (y) + 0x8000) >> 16)
|
||||
#define AAC_MUL26(x, y) (int)(((int64_t)(x) * (y) + 0x2000000) >> 26)
|
||||
#define AAC_MUL30(x, y) (int)(((int64_t)(x) * (y) + 0x20000000) >> 30)
|
||||
@@ -72,7 +72,7 @@
|
||||
#define AAC_MSUB31_V3(x, y, z) (int)((((int64_t)(x) * (z)) - \
|
||||
((int64_t)(y) * (z)) + \
|
||||
0x40000000) >> 31)
|
||||
#define AAC_HALF_SUM(x, y) (((x) >> 1) + ((y) >> 1))
|
||||
#define AAC_HALF_SUM(x, y) (x) >> 1 + (y) >> 1
|
||||
#define AAC_SRA_R(x, y) (int)(((x) + (1 << ((y) - 1))) >> (y))
|
||||
|
||||
#else
|
||||
|
||||
@@ -499,7 +499,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
|
||||
|
||||
+1
-3
@@ -423,8 +423,6 @@ static int read_payload_length_info(struct LATMContext *ctx, GetBitContext *gb)
|
||||
if (ctx->frame_length_type == 0) {
|
||||
int mux_slot_length = 0;
|
||||
do {
|
||||
if (get_bits_left(gb) < 8)
|
||||
return AVERROR_INVALIDDATA;
|
||||
tmp = get_bits(gb, 8);
|
||||
mux_slot_length += tmp;
|
||||
} while (tmp == 255);
|
||||
@@ -454,7 +452,7 @@ static int read_audio_mux_element(struct LATMContext *latmctx,
|
||||
}
|
||||
if (latmctx->audio_mux_version_A == 0) {
|
||||
int mux_slot_length_bytes = read_payload_length_info(latmctx, gb);
|
||||
if (mux_slot_length_bytes < 0 || mux_slot_length_bytes * 8LL > get_bits_left(gb)) {
|
||||
if (mux_slot_length_bytes * 8 > get_bits_left(gb)) {
|
||||
av_log(latmctx->aac_ctx.avctx, AV_LOG_ERROR, "incomplete frame\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else if (mux_slot_length_bytes * 8 + 256 < get_bits_left(gb)) {
|
||||
|
||||
+10
-20
@@ -124,7 +124,7 @@ static inline int *DEC_SQUAD(int *dst, unsigned idx)
|
||||
static inline int *DEC_UPAIR(int *dst, unsigned idx, unsigned sign)
|
||||
{
|
||||
dst[0] = (idx & 15) * (1 - (sign & 0xFFFFFFFE));
|
||||
dst[1] = (idx >> 4 & 15) * (1 - ((sign & 1) * 2));
|
||||
dst[1] = (idx >> 4 & 15) * (1 - ((sign & 1) << 1));
|
||||
|
||||
return dst + 2;
|
||||
}
|
||||
@@ -133,16 +133,16 @@ static inline int *DEC_UQUAD(int *dst, unsigned idx, unsigned sign)
|
||||
{
|
||||
unsigned nz = idx >> 12;
|
||||
|
||||
dst[0] = (idx & 3) * (1 + (((int)sign >> 31) * 2));
|
||||
dst[0] = (idx & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
sign <<= nz & 1;
|
||||
nz >>= 1;
|
||||
dst[1] = (idx >> 2 & 3) * (1 + (((int)sign >> 31) * 2));
|
||||
dst[1] = (idx >> 2 & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
sign <<= nz & 1;
|
||||
nz >>= 1;
|
||||
dst[2] = (idx >> 4 & 3) * (1 + (((int)sign >> 31) * 2));
|
||||
dst[2] = (idx >> 4 & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
sign <<= nz & 1;
|
||||
nz >>= 1;
|
||||
dst[3] = (idx >> 6 & 3) * (1 + (((int)sign >> 31) * 2));
|
||||
dst[3] = (idx >> 6 & 3) * (1 + (((int)sign >> 31) << 1));
|
||||
|
||||
return dst + 4;
|
||||
}
|
||||
@@ -170,11 +170,7 @@ static void subband_scale(int *dst, int *src, int scale, int offset, int len)
|
||||
|
||||
s = offset - (s >> 2);
|
||||
|
||||
if (s > 31) {
|
||||
for (i=0; i<len; i++) {
|
||||
dst[i] = 0;
|
||||
}
|
||||
} else if (s > 0) {
|
||||
if (s > 0) {
|
||||
round = 1 << (s-1);
|
||||
for (i=0; i<len; i++) {
|
||||
out = (int)(((int64_t)src[i] * c) >> 32);
|
||||
@@ -186,7 +182,7 @@ static void subband_scale(int *dst, int *src, int scale, int offset, int len)
|
||||
round = 1 << (s-1);
|
||||
for (i=0; i<len; i++) {
|
||||
out = (int)((int64_t)((int64_t)src[i] * c + round) >> s);
|
||||
dst[i] = out * (unsigned)ssign;
|
||||
dst[i] = out * ssign;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,12 +202,8 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len)
|
||||
c /= band_energy;
|
||||
s = 21 + nlz - (s >> 2);
|
||||
|
||||
if (s > 31) {
|
||||
for (i=0; i<len; i++) {
|
||||
coefs[i] = 0;
|
||||
}
|
||||
} else if (s >= 0) {
|
||||
round = s ? 1 << (s-1) : 0;
|
||||
if (s > 0) {
|
||||
round = 1 << (s-1);
|
||||
for (i=0; i<len; i++) {
|
||||
out = (int)(((int64_t)coefs[i] * c) >> 32);
|
||||
coefs[i] = ((int)(out+round) >> s) * ssign;
|
||||
@@ -369,9 +361,7 @@ static void apply_dependent_coupling_fixed(AACContext *ac,
|
||||
shift = (gain-1024) >> 3;
|
||||
}
|
||||
|
||||
if (shift < -31) {
|
||||
// Nothing to do
|
||||
} else if (shift < 0) {
|
||||
if (shift < 0) {
|
||||
shift = -shift;
|
||||
round = 1 << (shift - 1);
|
||||
|
||||
|
||||
@@ -449,10 +449,6 @@ static int output_configure(AACContext *ac,
|
||||
int type = layout_map[i][0];
|
||||
int id = layout_map[i][1];
|
||||
id_map[type][id] = type_counts[type]++;
|
||||
if (id_map[type][id] >= MAX_ELEM_ID) {
|
||||
avpriv_request_sample(ac->avctx, "Remapped id too large\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
}
|
||||
// Try to sniff a reasonable channel order, otherwise output the
|
||||
// channels in the order the PCE declared them.
|
||||
@@ -2143,11 +2139,7 @@ static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che)
|
||||
coup->coupling_point += get_bits1(gb) || (coup->coupling_point >> 1);
|
||||
|
||||
sign = get_bits(gb, 1);
|
||||
#if USE_FIXED
|
||||
scale = get_bits(gb, 2);
|
||||
#else
|
||||
scale = cce_scale[get_bits(gb, 2)];
|
||||
#endif
|
||||
scale = AAC_RENAME(cce_scale)[get_bits(gb, 2)];
|
||||
|
||||
if ((ret = decode_ics(ac, sce, gb, 0, 0)))
|
||||
return ret;
|
||||
@@ -2897,11 +2889,6 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
spectral_to_sample(ac, samples);
|
||||
|
||||
if (!ac->frame->data[0] && samples) {
|
||||
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
ac->frame->nb_samples = samples;
|
||||
ac->frame->sample_rate = avctx->sample_rate;
|
||||
*got_frame_ptr = 1;
|
||||
|
||||
+3
-8
@@ -493,7 +493,6 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
int ms_mode = 0, is_mode = 0, tns_mode = 0, pred_mode = 0;
|
||||
int chan_el_counter[4];
|
||||
FFPsyWindowInfo windows[AAC_MAX_CHANNELS];
|
||||
int k;
|
||||
|
||||
if (s->last_frame == 2)
|
||||
return 0;
|
||||
@@ -548,7 +547,6 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
ics->num_windows = wi[ch].num_windows;
|
||||
ics->swb_sizes = s->psy.bands [ics->num_windows == 8];
|
||||
ics->num_swb = tag == TYPE_LFE ? ics->num_swb : s->psy.num_bands[ics->num_windows == 8];
|
||||
ics->max_sfb = FFMIN(ics->max_sfb, ics->num_swb);
|
||||
ics->swb_offset = wi[ch].window_type[0] == EIGHT_SHORT_SEQUENCE ?
|
||||
ff_swb_offset_128 [s->samplerate_index]:
|
||||
ff_swb_offset_1024[s->samplerate_index];
|
||||
@@ -573,12 +571,9 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
}
|
||||
|
||||
apply_window_and_mdct(s, &cpe->ch[ch], overlap);
|
||||
|
||||
for (k = 0; k < 1024; k++) {
|
||||
if (!(fabs(cpe->ch[ch].coeffs[k]) < 1E16)) { // Ensure headroom for energy calculation
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains (near) NaN/+-Inf\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (isnan(cpe->ch->coeffs[0])) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Input contains NaN\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
avoid_clipping(s, &cpe->ch[ch]);
|
||||
}
|
||||
|
||||
+3
-3
@@ -940,9 +940,9 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
LOCAL_ALIGNED_16(INTFLOAT, h_step, [2], [4]);
|
||||
int start = ps->border_position[e];
|
||||
int stop = ps->border_position[e+1];
|
||||
INTFLOAT width = Q30(1.f) / ((stop - start) ? (stop - start) : 1);
|
||||
INTFLOAT width = Q30(1.f) / (stop - start);
|
||||
#if USE_FIXED
|
||||
width = FFMIN(2U*width, INT_MAX);
|
||||
width <<= 1;
|
||||
#endif
|
||||
b = k_to_i[k];
|
||||
h[0][0] = H11[0][e][b];
|
||||
@@ -975,7 +975,7 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
|
||||
h_step[1][3] = AAC_MSUB31_V3(H22[1][e+1][b], h[1][3], width);
|
||||
}
|
||||
ps->dsp.stereo_interpolate[!PS_BASELINE && ps->enable_ipdopd](
|
||||
l[k] + 1 + start, r[k] + 1 + start,
|
||||
l[k] + start + 1, r[k] + start + 1,
|
||||
h, h_step, stop - start);
|
||||
}
|
||||
}
|
||||
|
||||
+12
-37
@@ -169,10 +169,6 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
||||
else
|
||||
temp1.mant = 0x20000000;
|
||||
temp1.exp = (temp1.exp >> 1) + 1;
|
||||
if (temp1.exp > 66) { // temp1 > 1E20
|
||||
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||
temp1 = FLOAT_1;
|
||||
}
|
||||
|
||||
temp2.exp = (pan_offset - sbr->data[1].env_facs[e][k].mant) * alpha;
|
||||
if (temp2.exp & 1)
|
||||
@@ -192,10 +188,6 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
||||
temp1.exp = NOISE_FLOOR_OFFSET - \
|
||||
sbr->data[0].noise_facs[e][k].mant + 2;
|
||||
temp1.mant = 0x20000000;
|
||||
if (temp1.exp > 66) { // temp1 > 1E20
|
||||
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||
temp1 = FLOAT_1;
|
||||
}
|
||||
temp2.exp = 12 - sbr->data[1].noise_facs[e][k].mant + 1;
|
||||
temp2.mant = 0x20000000;
|
||||
fac = av_div_sf(temp1, av_add_sf(FLOAT_1, temp2));
|
||||
@@ -216,10 +208,7 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
||||
else
|
||||
temp1.mant = 0x20000000;
|
||||
temp1.exp = (temp1.exp >> 1) + 1;
|
||||
if (temp1.exp > 66) { // temp1 > 1E20
|
||||
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||
temp1 = FLOAT_1;
|
||||
}
|
||||
|
||||
sbr->data[ch].env_facs[e][k] = temp1;
|
||||
}
|
||||
for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
|
||||
@@ -291,8 +280,6 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
|
||||
shift = a00.exp;
|
||||
if (shift >= 3)
|
||||
alpha0[k][0] = 0x7fffffff;
|
||||
else if (shift <= -30)
|
||||
alpha0[k][0] = 0;
|
||||
else {
|
||||
a00.mant <<= 1;
|
||||
shift = 2-shift;
|
||||
@@ -307,8 +294,6 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
|
||||
shift = a01.exp;
|
||||
if (shift >= 3)
|
||||
alpha0[k][1] = 0x7fffffff;
|
||||
else if (shift <= -30)
|
||||
alpha0[k][1] = 0;
|
||||
else {
|
||||
a01.mant <<= 1;
|
||||
shift = 2-shift;
|
||||
@@ -322,8 +307,6 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
|
||||
shift = a10.exp;
|
||||
if (shift >= 3)
|
||||
alpha1[k][0] = 0x7fffffff;
|
||||
else if (shift <= -30)
|
||||
alpha1[k][0] = 0;
|
||||
else {
|
||||
a10.mant <<= 1;
|
||||
shift = 2-shift;
|
||||
@@ -338,8 +321,6 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
|
||||
shift = a11.exp;
|
||||
if (shift >= 3)
|
||||
alpha1[k][1] = 0x7fffffff;
|
||||
else if (shift <= -30)
|
||||
alpha1[k][1] = 0;
|
||||
else {
|
||||
a11.mant <<= 1;
|
||||
shift = 2-shift;
|
||||
@@ -416,8 +397,7 @@ static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr,
|
||||
int delta = !((e == e_a[1]) || (e == e_a[0]));
|
||||
for (k = 0; k < sbr->n_lim; k++) {
|
||||
SoftFloat gain_boost, gain_max;
|
||||
SoftFloat sum[2];
|
||||
sum[0] = sum[1] = FLOAT_0;
|
||||
SoftFloat sum[2] = { { 0, 0}, { 0, 0 } };
|
||||
for (m = sbr->f_tablelim[k] - sbr->kx[1]; m < sbr->f_tablelim[k + 1] - sbr->kx[1]; m++) {
|
||||
const SoftFloat temp = av_div_sf(sbr->e_origmapped[e][m],
|
||||
av_add_sf(FLOAT_1, sbr->q_mapped[e][m]));
|
||||
@@ -578,25 +558,20 @@ static void sbr_hf_assemble(int Y1[38][64][2],
|
||||
|
||||
SoftFloat *in = sbr->s_m[e];
|
||||
for (m = 0; m+1 < m_max; m+=2) {
|
||||
shift = 22 - in[m ].exp;
|
||||
if (shift < 32) {
|
||||
round = 1 << (shift-1);
|
||||
out[2*m ] += (in[m ].mant * A + round) >> shift;
|
||||
}
|
||||
shift = 22 - in[m ].exp;
|
||||
round = 1 << (shift-1);
|
||||
out[2*m ] += (in[m ].mant * A + round) >> shift;
|
||||
|
||||
shift = 22 - in[m+1].exp;
|
||||
if (shift < 32) {
|
||||
round = 1 << (shift-1);
|
||||
out[2*m+2] += (in[m+1].mant * B + round) >> shift;
|
||||
}
|
||||
shift = 22 - in[m+1].exp;
|
||||
round = 1 << (shift-1);
|
||||
out[2*m+2] += (in[m+1].mant * B + round) >> shift;
|
||||
}
|
||||
if(m_max&1)
|
||||
{
|
||||
shift = 22 - in[m ].exp;
|
||||
if (shift < 32) {
|
||||
round = 1 << (shift-1);
|
||||
out[2*m ] += (in[m ].mant * A + round) >> shift;
|
||||
}
|
||||
shift = 22 - in[m ].exp;
|
||||
round = 1 << (shift-1);
|
||||
|
||||
out[2*m ] += (in[m ].mant * A + round) >> shift;
|
||||
}
|
||||
}
|
||||
indexnoise = (indexnoise + m_max) & 0x1ff;
|
||||
|
||||
@@ -70,7 +70,6 @@ av_cold void AAC_RENAME(ff_aac_sbr_init)(void)
|
||||
/** Places SBR in pure upsampling mode. */
|
||||
static void sbr_turnoff(SpectralBandReplication *sbr) {
|
||||
sbr->start = 0;
|
||||
sbr->ready_for_dequant = 0;
|
||||
// Init defults used in pure upsampling mode
|
||||
sbr->kx[1] = 32; //Typo in spec, kx' inits to 32
|
||||
sbr->m[1] = 0;
|
||||
@@ -178,7 +177,6 @@ static unsigned int read_sbr_header(SpectralBandReplication *sbr, GetBitContext
|
||||
SpectrumParameters old_spectrum_params;
|
||||
|
||||
sbr->start = 1;
|
||||
sbr->ready_for_dequant = 0;
|
||||
|
||||
// Save last spectrum parameters variables to compare to new ones
|
||||
memcpy(&old_spectrum_params, &sbr->spectrum_params, sizeof(SpectrumParameters));
|
||||
@@ -621,26 +619,24 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
|
||||
int abs_bord_trail = 16;
|
||||
int num_rel_lead, num_rel_trail;
|
||||
unsigned bs_num_env_old = ch_data->bs_num_env;
|
||||
int bs_frame_class, bs_num_env;
|
||||
|
||||
ch_data->bs_freq_res[0] = ch_data->bs_freq_res[ch_data->bs_num_env];
|
||||
ch_data->bs_amp_res = sbr->bs_amp_res_header;
|
||||
ch_data->t_env_num_env_old = ch_data->t_env[bs_num_env_old];
|
||||
|
||||
switch (bs_frame_class = get_bits(gb, 2)) {
|
||||
switch (ch_data->bs_frame_class = get_bits(gb, 2)) {
|
||||
case FIXFIX:
|
||||
bs_num_env = 1 << get_bits(gb, 2);
|
||||
if (bs_num_env > 4) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
|
||||
bs_num_env);
|
||||
return -1;
|
||||
}
|
||||
ch_data->bs_num_env = bs_num_env;
|
||||
ch_data->bs_num_env = 1 << get_bits(gb, 2);
|
||||
num_rel_lead = ch_data->bs_num_env - 1;
|
||||
if (ch_data->bs_num_env == 1)
|
||||
ch_data->bs_amp_res = 0;
|
||||
|
||||
if (ch_data->bs_num_env > 4) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Invalid bitstream, too many SBR envelopes in FIXFIX type SBR frame: %d\n",
|
||||
ch_data->bs_num_env);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ch_data->t_env[0] = 0;
|
||||
ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
|
||||
@@ -688,15 +684,14 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
|
||||
abs_bord_trail += get_bits(gb, 2);
|
||||
num_rel_lead = get_bits(gb, 2);
|
||||
num_rel_trail = get_bits(gb, 2);
|
||||
bs_num_env = num_rel_lead + num_rel_trail + 1;
|
||||
ch_data->bs_num_env = num_rel_lead + num_rel_trail + 1;
|
||||
|
||||
if (bs_num_env > 5) {
|
||||
if (ch_data->bs_num_env > 5) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"Invalid bitstream, too many SBR envelopes in VARVAR type SBR frame: %d\n",
|
||||
bs_num_env);
|
||||
ch_data->bs_num_env);
|
||||
return -1;
|
||||
}
|
||||
ch_data->bs_num_env = bs_num_env;
|
||||
|
||||
ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
|
||||
|
||||
@@ -711,7 +706,6 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
|
||||
get_bits1_vector(gb, ch_data->bs_freq_res + 1, ch_data->bs_num_env);
|
||||
break;
|
||||
}
|
||||
ch_data->bs_frame_class = bs_frame_class;
|
||||
|
||||
av_assert0(bs_pointer >= 0);
|
||||
if (bs_pointer > ch_data->bs_num_env + 1) {
|
||||
@@ -722,8 +716,8 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
|
||||
}
|
||||
|
||||
for (i = 1; i <= ch_data->bs_num_env; i++) {
|
||||
if (ch_data->t_env[i-1] >= ch_data->t_env[i]) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "Not strictly monotone time borders\n");
|
||||
if (ch_data->t_env[i-1] > ch_data->t_env[i]) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR, "Non monotone time borders\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1038,7 +1032,6 @@ static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr,
|
||||
unsigned int cnt = get_bits_count(gb);
|
||||
|
||||
sbr->id_aac = id_aac;
|
||||
sbr->ready_for_dequant = 1;
|
||||
|
||||
if (id_aac == TYPE_SCE || id_aac == TYPE_CCE) {
|
||||
if (read_sbr_single_channel_element(ac, sbr, gb)) {
|
||||
@@ -1158,9 +1151,6 @@ static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
|
||||
INTFLOAT z[320], INTFLOAT W[2][32][32][2], int buf_idx)
|
||||
{
|
||||
int i;
|
||||
#if USE_FIXED
|
||||
int j;
|
||||
#endif
|
||||
memcpy(x , x+1024, (320-32)*sizeof(x[0]));
|
||||
memcpy(x+288, in, 1024*sizeof(x[0]));
|
||||
for (i = 0; i < 32; i++) { // numTimeSlots*RATE = 16*2 as 960 sample frames
|
||||
@@ -1168,21 +1158,6 @@ static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
|
||||
dsp->vector_fmul_reverse(z, sbr_qmf_window_ds, x, 320);
|
||||
sbrdsp->sum64x5(z);
|
||||
sbrdsp->qmf_pre_shuffle(z);
|
||||
#if USE_FIXED
|
||||
for (j = 64; j < 128; j++) {
|
||||
if (z[j] > 1<<24) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"sbr_qmf_analysis: value %09d too large, setting to %09d\n",
|
||||
z[j], 1<<24);
|
||||
z[j] = 1<<24;
|
||||
} else if (z[j] < -(1<<24)) {
|
||||
av_log(NULL, AV_LOG_WARNING,
|
||||
"sbr_qmf_analysis: value %09d too small, setting to %09d\n",
|
||||
z[j], -(1<<24));
|
||||
z[j] = -(1<<24);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
mdct->imdct_half(mdct, z, z+64);
|
||||
sbrdsp->qmf_post_shuffle(W[buf_idx][i], z);
|
||||
x += 32;
|
||||
@@ -1437,7 +1412,7 @@ static void sbr_env_estimate(AAC_FLOAT (*e_curr)[48], INTFLOAT X_high[64][40][2]
|
||||
|
||||
for (p = 0; p < sbr->n[ch_data->bs_freq_res[e + 1]]; p++) {
|
||||
#if USE_FIXED
|
||||
SoftFloat sum = FLOAT_0;
|
||||
SoftFloat sum = { 0, 0 };
|
||||
const SoftFloat den = av_int2sf(0x20000000 / (env_size * (table[p + 1] - table[p])), 29);
|
||||
for (k = table[p]; k < table[p + 1]; k++) {
|
||||
sum = av_add_sf(sum, sbr->dsp.sum_square(X_high[k] + ilb, iub - ilb));
|
||||
@@ -1474,12 +1449,6 @@ void AAC_RENAME(ff_sbr_apply)(AACContext *ac, SpectralBandReplication *sbr, int
|
||||
sbr_turnoff(sbr);
|
||||
}
|
||||
|
||||
if (sbr->start && !sbr->ready_for_dequant) {
|
||||
av_log(ac->avctx, AV_LOG_ERROR,
|
||||
"No quantized data read for sbr_dequant.\n");
|
||||
sbr_turnoff(sbr);
|
||||
}
|
||||
|
||||
if (!sbr->kx_and_m_pushed) {
|
||||
sbr->kx[0] = sbr->kx[1];
|
||||
sbr->m[0] = sbr->m[1];
|
||||
@@ -1489,7 +1458,6 @@ void AAC_RENAME(ff_sbr_apply)(AACContext *ac, SpectralBandReplication *sbr, int
|
||||
|
||||
if (sbr->start) {
|
||||
sbr_dequant(sbr, id_aac);
|
||||
sbr->ready_for_dequant = 0;
|
||||
}
|
||||
for (ch = 0; ch < nch; ch++) {
|
||||
/* decode channel */
|
||||
|
||||
+18
-23
@@ -750,31 +750,30 @@ static void ac3_upmix_delay(AC3DecodeContext *s)
|
||||
* @param[in] default_band_struct default band structure table
|
||||
* @param[out] num_bands number of bands (optionally NULL)
|
||||
* @param[out] band_sizes array containing the number of bins in each band (optionally NULL)
|
||||
* @param[in,out] band_struct current band structure
|
||||
*/
|
||||
static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
|
||||
int ecpl, int start_subband, int end_subband,
|
||||
const uint8_t *default_band_struct,
|
||||
int *num_bands, uint8_t *band_sizes,
|
||||
uint8_t *band_struct, int band_struct_size)
|
||||
int *num_bands, uint8_t *band_sizes)
|
||||
{
|
||||
int subbnd, bnd, n_subbands, n_bands=0;
|
||||
uint8_t bnd_sz[22];
|
||||
uint8_t coded_band_struct[22];
|
||||
const uint8_t *band_struct;
|
||||
|
||||
n_subbands = end_subband - start_subband;
|
||||
|
||||
if (!blk)
|
||||
memcpy(band_struct, default_band_struct, band_struct_size);
|
||||
|
||||
av_assert0(band_struct_size >= start_subband + n_subbands);
|
||||
|
||||
band_struct += start_subband + 1;
|
||||
|
||||
/* decode band structure from bitstream or use default */
|
||||
if (!eac3 || get_bits1(gbc)) {
|
||||
for (subbnd = 0; subbnd < n_subbands - 1; subbnd++) {
|
||||
band_struct[subbnd] = get_bits1(gbc);
|
||||
coded_band_struct[subbnd] = get_bits1(gbc);
|
||||
}
|
||||
band_struct = coded_band_struct;
|
||||
} else if (!blk) {
|
||||
band_struct = &default_band_struct[start_subband+1];
|
||||
} else {
|
||||
/* no change in band structure */
|
||||
return;
|
||||
}
|
||||
|
||||
/* calculate number of bands and band sizes based on band structure.
|
||||
@@ -901,15 +900,12 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
start_subband, end_subband,
|
||||
ff_eac3_default_spx_band_struct,
|
||||
&s->num_spx_bands,
|
||||
s->spx_band_sizes,
|
||||
s->spx_band_struct, sizeof(s->spx_band_struct));
|
||||
}
|
||||
}
|
||||
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;
|
||||
s->spx_band_sizes);
|
||||
} else {
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
s->channel_uses_spx[ch] = 0;
|
||||
s->first_spx_coords[ch] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1036,8 +1032,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
decode_band_structure(gbc, blk, s->eac3, 0, cpl_start_subband,
|
||||
cpl_end_subband,
|
||||
ff_eac3_default_cpl_band_struct,
|
||||
&s->num_cpl_bands, s->cpl_band_sizes,
|
||||
s->cpl_band_struct, sizeof(s->cpl_band_struct));
|
||||
&s->num_cpl_bands, s->cpl_band_sizes);
|
||||
} else {
|
||||
/* coupling not in use */
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
@@ -1338,7 +1333,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
for (ch = 1; ch <= s->channels; ch++) {
|
||||
int audio_channel = 0;
|
||||
INTFLOAT gain;
|
||||
if (s->channel_mode == AC3_CHMODE_DUALMONO && ch <= 2)
|
||||
if (s->channel_mode == AC3_CHMODE_DUALMONO)
|
||||
audio_channel = 2-ch;
|
||||
if (s->heavy_compression && s->compression_exists[audio_channel])
|
||||
gain = s->heavy_dynamic_range[audio_channel];
|
||||
|
||||
@@ -126,7 +126,6 @@ typedef struct AC3DecodeContext {
|
||||
int phase_flags_in_use; ///< phase flags in use (phsflginu)
|
||||
int phase_flags[AC3_MAX_CPL_BANDS]; ///< phase flags (phsflg)
|
||||
int num_cpl_bands; ///< number of coupling bands (ncplbnd)
|
||||
uint8_t cpl_band_struct[AC3_MAX_CPL_BANDS];
|
||||
uint8_t cpl_band_sizes[AC3_MAX_CPL_BANDS]; ///< number of coeffs in each coupling band
|
||||
int firstchincpl; ///< first channel in coupling
|
||||
int first_cpl_coords[AC3_MAX_CHANNELS]; ///< first coupling coordinates states (firstcplcos)
|
||||
@@ -143,7 +142,6 @@ typedef struct AC3DecodeContext {
|
||||
int spx_dst_start_freq; ///< spx starting frequency bin for copying (copystartmant)
|
||||
///< the copy region ends at the start of the spx region.
|
||||
int num_spx_bands; ///< number of spx bands (nspxbnds)
|
||||
uint8_t spx_band_struct[SPX_MAX_BANDS];
|
||||
uint8_t spx_band_sizes[SPX_MAX_BANDS]; ///< number of bins in each spx band
|
||||
uint8_t first_spx_coords[AC3_MAX_CHANNELS]; ///< first spx coordinates states (firstspxcos)
|
||||
INTFLOAT spx_noise_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spx noise blending factor (nblendfact)
|
||||
|
||||
@@ -69,7 +69,7 @@ static void scale_coefs (
|
||||
int temp, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
|
||||
|
||||
mul = (dynrng & 0x1f) + 0x20;
|
||||
shift = 4 - (sign_extend(dynrng, 9) >> 5);
|
||||
shift = 4 - ((dynrng << 23) >> 28);
|
||||
if (shift > 0 ) {
|
||||
round = 1 << (shift-1);
|
||||
for (i=0; i<len; i+=8) {
|
||||
|
||||
@@ -135,7 +135,7 @@ float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy,
|
||||
exp2f(M_LOG2_10 * 0.05 *
|
||||
(avpriv_scalarproduct_float_c(pred_table, prediction_error, 4) +
|
||||
energy_mean)) /
|
||||
sqrtf(fixed_mean_energy ? fixed_mean_energy : 1.0);
|
||||
sqrtf(fixed_mean_energy);
|
||||
|
||||
// update quantified prediction error energy history
|
||||
memmove(&prediction_error[0], &prediction_error[1],
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ static int adx_decode(ADXContext *c, int16_t *out, int offset,
|
||||
s2 = prev->s2;
|
||||
for (i = 0; i < BLOCK_SAMPLES; i++) {
|
||||
d = get_sbits(&gb, 4);
|
||||
s0 = ((d * (1 << COEFF_BITS)) * scale + c->coeff[0] * s1 + c->coeff[1] * s2) >> COEFF_BITS;
|
||||
s0 = ((d << COEFF_BITS) * scale + c->coeff[0] * s1 + c->coeff[1] * s2) >> COEFF_BITS;
|
||||
s2 = s1;
|
||||
s1 = av_clip_int16(s0);
|
||||
*out++ = s1;
|
||||
|
||||
+1
-6
@@ -765,13 +765,8 @@ static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
|
||||
bd->ltp_gain[0] = decode_rice(gb, 1) << 3;
|
||||
bd->ltp_gain[1] = decode_rice(gb, 2) << 3;
|
||||
|
||||
r = get_unary(gb, 0, 4);
|
||||
r = get_unary(gb, 0, 3);
|
||||
c = get_bits(gb, 2);
|
||||
if (r >= 4) {
|
||||
av_log(avctx, AV_LOG_ERROR, "r overflow\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
bd->ltp_gain[2] = ltp_gain_values[r][c];
|
||||
|
||||
bd->ltp_gain[3] = decode_rice(gb, 2) << 3;
|
||||
|
||||
@@ -265,7 +265,7 @@ static void decode_pitch_lag_high(int *lag_int, int *lag_frac, int pitch_index,
|
||||
*lag_frac = pitch_index - (*lag_int << 2) + 136;
|
||||
} else if (pitch_index < 440) {
|
||||
*lag_int = (pitch_index + 257 - 376) >> 1;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) * 2;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) << 1;
|
||||
/* the actual resolution is 1/2 but expressed as 1/4 */
|
||||
} else {
|
||||
*lag_int = pitch_index - 280;
|
||||
@@ -295,7 +295,7 @@ static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,
|
||||
if (subframe == 0 || (subframe == 2 && mode != MODE_6k60)) {
|
||||
if (pitch_index < 116) {
|
||||
*lag_int = (pitch_index + 69) >> 1;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1) + 68) * 2;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1) + 68) << 1;
|
||||
} else {
|
||||
*lag_int = pitch_index - 24;
|
||||
*lag_frac = 0;
|
||||
@@ -305,7 +305,7 @@ static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,
|
||||
AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);
|
||||
} else {
|
||||
*lag_int = (pitch_index + 1) >> 1;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1)) * 2;
|
||||
*lag_frac = (pitch_index - (*lag_int << 1)) << 1;
|
||||
*lag_int += *base_lag_int;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-8
@@ -80,6 +80,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
AnsiContext *s = avctx->priv_data;
|
||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||
|
||||
s->frame = av_frame_alloc();
|
||||
if (!s->frame)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
/* defaults */
|
||||
s->font = avpriv_vga16_font;
|
||||
s->font_height = 16;
|
||||
@@ -90,15 +94,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
int ret = ff_set_dimensions(avctx, 80 << 3, 25 << 4);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
} else if (avctx->width % FONT_WIDTH || avctx->height % s->font_height) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid dimensions %d %d\n", avctx->width, avctx->height);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
s->frame = av_frame_alloc();
|
||||
if (!s->frame)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+1
-4
@@ -892,9 +892,6 @@ static void long_filter_high_3800(int32_t *buffer, int order, int shift, int len
|
||||
int32_t dotprod, sign;
|
||||
int32_t coeffs[256], delay[256];
|
||||
|
||||
if (order >= length)
|
||||
return;
|
||||
|
||||
memset(coeffs, 0, order * sizeof(*coeffs));
|
||||
for (i = 0; i < order; i++)
|
||||
delay[i] = buffer[i];
|
||||
@@ -1372,7 +1369,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;
|
||||
|
||||
@@ -525,7 +525,7 @@ ASSStyle *ff_ass_style_get(ASSSplitContext *ctx, const char *style)
|
||||
if (!style || !*style)
|
||||
style = "Default";
|
||||
for (i=0; i<ass->styles_count; i++)
|
||||
if (ass->styles[i].name && !strcmp(ass->styles[i].name, style))
|
||||
if (!strcmp(ass->styles[i].name, style))
|
||||
return ass->styles + i;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ static inline void asv2_put_level(ASV1Context *a, PutBitContext *pb, int level)
|
||||
} else {
|
||||
put_bits(pb, ff_asv2_level_tab[31][1], ff_asv2_level_tab[31][0]);
|
||||
if (level < -128 || level > 127) {
|
||||
av_log(a->avctx, AV_LOG_WARNING, "Clipping level %d, increase qscale\n", level);
|
||||
av_log(a->avctx, AV_LOG_WARNING, "Cliping level %d, increase qscale\n", level);
|
||||
level = av_clip_int8(level);
|
||||
}
|
||||
asv2_put_bits(pb, 8, level & 0xFF);
|
||||
|
||||
@@ -1365,16 +1365,6 @@ enum AVPacketSideDataType {
|
||||
* side data includes updated metadata which appeared in the stream.
|
||||
*/
|
||||
AV_PKT_DATA_METADATA_UPDATE,
|
||||
|
||||
/**
|
||||
* The number of side data elements (in fact a bit more than it).
|
||||
* This is not part of the public API/ABI in the sense that it may
|
||||
* change when new side data types are added.
|
||||
* This must stay the last enum value.
|
||||
* If its value becomes huge, some code using it
|
||||
* needs to be updated as it assumes it to be smaller than other limits.
|
||||
*/
|
||||
AV_PKT_DATA_NB
|
||||
};
|
||||
|
||||
#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
|
||||
|
||||
+5
-17
@@ -58,7 +58,6 @@ void av_init_packet(AVPacket *pkt)
|
||||
#if FF_API_DESTRUCT_PACKET
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
pkt->destruct = NULL;
|
||||
pkt->priv = NULL;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
pkt->buf = NULL;
|
||||
@@ -195,7 +194,6 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
|
||||
{
|
||||
pkt->data = NULL;
|
||||
pkt->side_data = NULL;
|
||||
pkt->side_data_elems = 0;
|
||||
if (pkt->buf) {
|
||||
AVBufferRef *ref = av_buffer_ref(src->buf);
|
||||
if (!ref)
|
||||
@@ -210,11 +208,9 @@ FF_DISABLE_DEPRECATION_WARNINGS
|
||||
pkt->destruct = dummy_destruct_packet;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
if (src->side_data_elems && dup) {
|
||||
if (pkt->side_data_elems && dup)
|
||||
pkt->side_data = src->side_data;
|
||||
pkt->side_data_elems = src->side_data_elems;
|
||||
}
|
||||
if (src->side_data_elems && !dup) {
|
||||
if (pkt->side_data_elems && !dup) {
|
||||
return av_copy_packet_side_data(pkt, src);
|
||||
}
|
||||
return 0;
|
||||
@@ -305,12 +301,11 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
{
|
||||
int elems = pkt->side_data_elems;
|
||||
|
||||
if ((unsigned)elems + 1 > AV_PKT_DATA_NB)
|
||||
if ((unsigned)elems + 1 > INT_MAX / sizeof(*pkt->side_data))
|
||||
return NULL;
|
||||
if ((unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
|
||||
return NULL;
|
||||
|
||||
|
||||
pkt->side_data = av_realloc(pkt->side_data,
|
||||
(elems + 1) * sizeof(*pkt->side_data));
|
||||
if (!pkt->side_data)
|
||||
@@ -338,8 +333,6 @@ uint8_t *av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
return pkt->side_data[i].data;
|
||||
}
|
||||
}
|
||||
if (size)
|
||||
*size = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -417,18 +410,13 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p = pkt->data + pkt->size - 8 - 5;
|
||||
for (i=1; ; i++){
|
||||
size = AV_RB32(p);
|
||||
if (size>INT_MAX - 5 || p - pkt->data < size)
|
||||
if (size>INT_MAX || p - pkt->data < size)
|
||||
return 0;
|
||||
if (p[4]&128)
|
||||
break;
|
||||
if (p - pkt->data < size + 5)
|
||||
return 0;
|
||||
p-= size+5;
|
||||
}
|
||||
|
||||
if (i > AV_PKT_DATA_NB)
|
||||
return AVERROR(ERANGE);
|
||||
|
||||
pkt->side_data = av_malloc_array(i, sizeof(*pkt->side_data));
|
||||
if (!pkt->side_data)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -436,7 +424,7 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p= pkt->data + pkt->size - 8 - 5;
|
||||
for (i=0; ; i++){
|
||||
size= AV_RB32(p);
|
||||
av_assert0(size<=INT_MAX - 5 && p - pkt->data >= size);
|
||||
av_assert0(size<=INT_MAX && p - pkt->data >= size);
|
||||
pkt->side_data[i].data = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
pkt->side_data[i].size = size;
|
||||
pkt->side_data[i].type = p[4]&127;
|
||||
|
||||
@@ -113,7 +113,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
|
||||
int shift = p->height - avctx->height;
|
||||
int subsample_h, subsample_v;
|
||||
|
||||
av_pix_fmt_get_chroma_sub_sample(p->format, &subsample_h, &subsample_v);
|
||||
av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &subsample_h, &subsample_v);
|
||||
|
||||
p->data[0] += p->linesize[0] * shift;
|
||||
if (p->data[2]) {
|
||||
|
||||
+3
-11
@@ -53,8 +53,7 @@ restart:
|
||||
if (bpc->pc.frame_start_found == 0) {
|
||||
if ((state >> 48) == (('B' << 8) | 'M')) {
|
||||
bpc->fsize = av_bswap32(state >> 16);
|
||||
if (bpc->fsize > 17)
|
||||
bpc->pc.frame_start_found = 1;
|
||||
bpc->pc.frame_start_found = 1;
|
||||
}
|
||||
} else if (bpc->pc.frame_start_found == 2+4+4) {
|
||||
// unsigned hsize = av_bswap32(state>>32);
|
||||
@@ -68,12 +67,8 @@ restart:
|
||||
|
||||
if (bpc->pc.index + i > 17) {
|
||||
next = i - 17;
|
||||
state = 0;
|
||||
break;
|
||||
} else {
|
||||
bpc->pc.state64 = 0;
|
||||
} else
|
||||
goto restart;
|
||||
}
|
||||
} else if (bpc->pc.frame_start_found)
|
||||
bpc->pc.frame_start_found++;
|
||||
}
|
||||
@@ -94,10 +89,7 @@ flush:
|
||||
if (ff_combine_frame(&bpc->pc, next, &buf, &buf_size) < 0)
|
||||
return buf_size;
|
||||
|
||||
if (next != END_NOT_FOUND && next < 0)
|
||||
bpc->pc.frame_start_found = FFMAX(bpc->pc.frame_start_found - i - 1, 0);
|
||||
else
|
||||
bpc->pc.frame_start_found = 0;
|
||||
bpc->pc.frame_start_found = 0;
|
||||
|
||||
*poutbuf = buf;
|
||||
*poutbuf_size = buf_size;
|
||||
|
||||
@@ -107,7 +107,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
|
||||
if (src < source || src >= source_end)
|
||||
return AVERROR_INVALIDDATA;
|
||||
shift += 2;
|
||||
val |= (unsigned)*src << shift;
|
||||
val |= *src << shift;
|
||||
if (*src & 0xC)
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-4
@@ -51,7 +51,7 @@ void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size){
|
||||
*
|
||||
* @param buf_size size of buf in bits
|
||||
*/
|
||||
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
|
||||
void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
|
||||
c->bytestream_start=
|
||||
c->bytestream= buf;
|
||||
c->bytestream_end= buf + buf_size;
|
||||
@@ -64,9 +64,6 @@ int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
|
||||
#endif
|
||||
c->low+= ((*c->bytestream++)<<2) + 2;
|
||||
c->range= 0x1FE;
|
||||
if ((c->range<<(CABAC_BITS+1)) < c->low)
|
||||
return AVERROR_INVALIDDATA;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ff_init_cabac_states(void)
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ typedef struct CABACContext{
|
||||
}CABACContext;
|
||||
|
||||
void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size);
|
||||
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
|
||||
void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size);
|
||||
void ff_init_cabac_states(void);
|
||||
|
||||
#endif /* AVCODEC_CABAC_H */
|
||||
|
||||
@@ -74,8 +74,7 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
|
||||
|
||||
#ifndef get_cabac_inline
|
||||
static void refill2(CABACContext *c){
|
||||
int i;
|
||||
unsigned x;
|
||||
int i, x;
|
||||
|
||||
x= c->low ^ (c->low-1);
|
||||
i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)];
|
||||
@@ -191,8 +190,7 @@ static av_unused const uint8_t* skip_bytes(CABACContext *c, int n) {
|
||||
#endif
|
||||
if ((int) (c->bytestream_end - ptr) < n)
|
||||
return NULL;
|
||||
if (ff_init_cabac_decoder(c, ptr + n, c->bytestream_end - ptr - n) < 0)
|
||||
return NULL;
|
||||
ff_init_cabac_decoder(c, ptr + n, c->bytestream_end - ptr - n);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
+4
-10
@@ -538,7 +538,8 @@ void ff_cavs_inter(AVSContext *h, enum cavs_mb mb_type)
|
||||
static inline void scale_mv(AVSContext *h, int *d_x, int *d_y,
|
||||
cavs_vector *src, int distp)
|
||||
{
|
||||
int64_t den = h->scale_den[FFMAX(src->ref, 0)];
|
||||
int den = h->scale_den[FFMAX(src->ref, 0)];
|
||||
|
||||
*d_x = (src->x * distp * den + 256 + FF_SIGNBIT(src->x)) >> 9;
|
||||
*d_y = (src->y * distp * den + 256 + FF_SIGNBIT(src->y)) >> 9;
|
||||
}
|
||||
@@ -613,15 +614,8 @@ void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC,
|
||||
mv_pred_median(h, mvP, mvA, mvB, mvC);
|
||||
|
||||
if (mode < MV_PRED_PSKIP) {
|
||||
int mx = get_se_golomb(&h->gb) + (unsigned)mvP->x;
|
||||
int my = get_se_golomb(&h->gb) + (unsigned)mvP->y;
|
||||
|
||||
if (mx != (int16_t)mx || my != (int16_t)my) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "MV %d %d out of supported range\n", mx, my);
|
||||
} else {
|
||||
mvP->x = mx;
|
||||
mvP->y = my;
|
||||
}
|
||||
mvP->x += get_se_golomb(&h->gb);
|
||||
mvP->y += get_se_golomb(&h->gb);
|
||||
}
|
||||
set_mvs(mvP, size);
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ static inline void mv_pred_direct(AVSContext *h, cavs_vector *pmv_fw,
|
||||
cavs_vector *col_mv)
|
||||
{
|
||||
cavs_vector *pmv_bw = pmv_fw + MV_BWD_OFFS;
|
||||
unsigned den = h->direct_den[col_mv->ref];
|
||||
int den = h->direct_den[col_mv->ref];
|
||||
int m = FF_SIGNBIT(col_mv->x);
|
||||
|
||||
pmv_fw->dist = h->dist[1];
|
||||
@@ -616,7 +616,7 @@ static inline int decode_residual_inter(AVSContext *h)
|
||||
|
||||
/* get quantizer */
|
||||
if (h->cbp && !h->qp_fixed)
|
||||
h->qp = (h->qp + (unsigned)get_se_golomb(&h->gb)) & 63;
|
||||
h->qp = (h->qp + get_se_golomb(&h->gb)) & 63;
|
||||
for (block = 0; block < 4; block++)
|
||||
if (h->cbp & (1 << block))
|
||||
decode_residual_block(h, &h->gb, inter_dec, 0, h->qp,
|
||||
@@ -1032,10 +1032,6 @@ static int decode_pic(AVSContext *h)
|
||||
h->scale_den[1] = h->dist[1] ? 512/h->dist[1] : 0;
|
||||
if (h->cur.f->pict_type == AV_PICTURE_TYPE_B) {
|
||||
h->sym_factor = h->dist[0] * h->scale_den[1];
|
||||
if (FFABS(h->sym_factor) > 32768) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "sym_factor %d too large\n", h->sym_factor);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
} else {
|
||||
h->direct_den[0] = h->dist[0] ? 16384 / h->dist[0] : 0;
|
||||
h->direct_den[1] = h->dist[1] ? 16384 / h->dist[1] : 0;
|
||||
@@ -1222,8 +1218,6 @@ static int cavs_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
h->got_keyframe = 1;
|
||||
}
|
||||
case PIC_PB_START_CODE:
|
||||
if (*got_frame)
|
||||
av_frame_unref(data);
|
||||
*got_frame = 0;
|
||||
if (!h->got_keyframe)
|
||||
break;
|
||||
|
||||
@@ -188,6 +188,7 @@ static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc
|
||||
static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
|
||||
int i;
|
||||
int16_t (*src)[8] = (int16_t(*)[8])block;
|
||||
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
|
||||
|
||||
src[0][0] += 8;
|
||||
|
||||
@@ -242,14 +243,14 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
|
||||
const int b2 = a5 - a7;
|
||||
const int b3 = a4 - a6;
|
||||
|
||||
dst[i + 0*stride] = av_clip_uint8( dst[i + 0*stride] + ((b0 + b4) >> 7));
|
||||
dst[i + 1*stride] = av_clip_uint8( dst[i + 1*stride] + ((b1 + b5) >> 7));
|
||||
dst[i + 2*stride] = av_clip_uint8( dst[i + 2*stride] + ((b2 + b6) >> 7));
|
||||
dst[i + 3*stride] = av_clip_uint8( dst[i + 3*stride] + ((b3 + b7) >> 7));
|
||||
dst[i + 4*stride] = av_clip_uint8( dst[i + 4*stride] + ((b3 - b7) >> 7));
|
||||
dst[i + 5*stride] = av_clip_uint8( dst[i + 5*stride] + ((b2 - b6) >> 7));
|
||||
dst[i + 6*stride] = av_clip_uint8( dst[i + 6*stride] + ((b1 - b5) >> 7));
|
||||
dst[i + 7*stride] = av_clip_uint8( dst[i + 7*stride] + ((b0 - b4) >> 7));
|
||||
dst[i + 0*stride] = cm[ dst[i + 0*stride] + ((b0 + b4) >> 7)];
|
||||
dst[i + 1*stride] = cm[ dst[i + 1*stride] + ((b1 + b5) >> 7)];
|
||||
dst[i + 2*stride] = cm[ dst[i + 2*stride] + ((b2 + b6) >> 7)];
|
||||
dst[i + 3*stride] = cm[ dst[i + 3*stride] + ((b3 + b7) >> 7)];
|
||||
dst[i + 4*stride] = cm[ dst[i + 4*stride] + ((b3 - b7) >> 7)];
|
||||
dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((b2 - b6) >> 7)];
|
||||
dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((b1 - b5) >> 7)];
|
||||
dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b4) >> 7)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
-11
@@ -168,8 +168,7 @@ typedef struct CCaptionSubContext {
|
||||
int64_t end_time;
|
||||
char prev_cmd[2];
|
||||
/* buffer to store pkt data */
|
||||
uint8_t *pktbuf;
|
||||
int pktbuf_size;
|
||||
AVBufferRef *pktbuf;
|
||||
}CCaptionSubContext;
|
||||
|
||||
|
||||
@@ -186,7 +185,11 @@ static av_cold int init_decoder(AVCodecContext *avctx)
|
||||
if(ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* allocate pkt buffer */
|
||||
ctx->pktbuf = av_buffer_alloc(128);
|
||||
if( !ctx->pktbuf) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -194,8 +197,7 @@ static av_cold int close_decoder(AVCodecContext *avctx)
|
||||
{
|
||||
CCaptionSubContext *ctx = avctx->priv_data;
|
||||
av_bprint_finalize( &ctx->buffer, NULL);
|
||||
av_freep(&ctx->pktbuf);
|
||||
ctx->pktbuf_size = 0;
|
||||
av_buffer_unref(&ctx->pktbuf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -527,13 +529,16 @@ static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avp
|
||||
int ret = 0;
|
||||
int i;
|
||||
|
||||
av_fast_padded_malloc(&ctx->pktbuf, &ctx->pktbuf_size, len);
|
||||
if (!ctx->pktbuf) {
|
||||
av_log(ctx, AV_LOG_WARNING, "Insufficient Memory of %d truncated to %d\n", len, ctx->pktbuf_size);
|
||||
return AVERROR(ENOMEM);
|
||||
if ( ctx->pktbuf->size < len) {
|
||||
ret = av_buffer_realloc(&ctx->pktbuf, len);
|
||||
if(ret < 0) {
|
||||
av_log(ctx, AV_LOG_WARNING, "Insufficient Memory of %d truncated to %d\n",len, ctx->pktbuf->size);
|
||||
len = ctx->pktbuf->size;
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
memcpy(ctx->pktbuf, avpkt->data, len);
|
||||
bptr = ctx->pktbuf;
|
||||
memcpy(ctx->pktbuf->data, avpkt->data, len);
|
||||
bptr = ctx->pktbuf->data;
|
||||
|
||||
|
||||
for (i = 0; i < len; i += 3) {
|
||||
|
||||
+3
-3
@@ -252,11 +252,11 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
aligned_width = FFALIGN(c->avctx->width, 16);
|
||||
c->padded_bits = aligned_width - c->avctx->width;
|
||||
if (c->video_size < aligned_width * avctx->height * (int64_t)c->bpp / 8)
|
||||
if (c->video_size < aligned_width * avctx->height * c->bpp / 8)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (!encoding && c->palette_size && c->bpp <= 8 && c->format != CHUNKY) {
|
||||
if (!encoding && c->palette_size && c->bpp <= 8) {
|
||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||
} else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8) && c->format != CHUNKY) {
|
||||
} else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8)) {
|
||||
if (c->palette_size != (1 << (c->bpp - 1)))
|
||||
return AVERROR_INVALIDDATA;
|
||||
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
||||
|
||||
@@ -322,6 +322,9 @@ static int cinepak_decode (CinepakContext *s)
|
||||
int y0 = 0;
|
||||
int encoded_buf_size;
|
||||
|
||||
if (s->size < 10)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
frame_flags = s->data[0];
|
||||
num_strips = AV_RB16 (&s->data[8]);
|
||||
encoded_buf_size = AV_RB24(&s->data[1]);
|
||||
@@ -436,20 +439,14 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
|
||||
s->data = buf;
|
||||
s->size = buf_size;
|
||||
|
||||
if (s->size < 10)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
|
||||
return ret;
|
||||
|
||||
if (s->palette_video) {
|
||||
int size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
|
||||
if (pal && size == AVPALETTE_SIZE) {
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
|
||||
if (pal) {
|
||||
s->frame->palette_has_changed = 1;
|
||||
memcpy(s->pal, pal, AVPALETTE_SIZE);
|
||||
} else if (pal) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-22
@@ -29,10 +29,6 @@
|
||||
#include "avcodec.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define VLC_BITS 7
|
||||
#define VLC_DEPTH 2
|
||||
|
||||
|
||||
typedef struct CLLCContext {
|
||||
AVCodecContext *avctx;
|
||||
BswapDSPContext bdsp;
|
||||
@@ -55,13 +51,6 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
|
||||
|
||||
num_lens = get_bits(gb, 5);
|
||||
|
||||
if (num_lens > VLC_BITS * VLC_DEPTH) {
|
||||
vlc->table = NULL;
|
||||
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "To long VLCs %d\n", num_lens);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_lens; i++) {
|
||||
num_codes = get_bits(gb, 9);
|
||||
num_codes_sum += num_codes;
|
||||
@@ -81,15 +70,11 @@ static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
|
||||
|
||||
count++;
|
||||
}
|
||||
if (prefix > (65535 - 256)/2) {
|
||||
vlc->table = NULL;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
prefix <<= 1;
|
||||
}
|
||||
|
||||
return ff_init_vlc_sparse(vlc, VLC_BITS, count, bits, 1, 1,
|
||||
return ff_init_vlc_sparse(vlc, 7, count, bits, 1, 1,
|
||||
codes, 2, 2, symbols, 1, 1, 0);
|
||||
}
|
||||
|
||||
@@ -116,7 +101,7 @@ static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left,
|
||||
for (i = 0; i < ctx->avctx->width; i++) {
|
||||
/* Always get the alpha component */
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc[0].table, VLC_BITS, VLC_DEPTH);
|
||||
GET_VLC(code, bits, gb, vlc[0].table, 7, 2);
|
||||
|
||||
pred[0] += code;
|
||||
dst[0] = pred[0];
|
||||
@@ -125,21 +110,21 @@ static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left,
|
||||
if (dst[0]) {
|
||||
/* Red */
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc[1].table, VLC_BITS, VLC_DEPTH);
|
||||
GET_VLC(code, bits, gb, vlc[1].table, 7, 2);
|
||||
|
||||
pred[1] += code;
|
||||
dst[1] = pred[1];
|
||||
|
||||
/* Green */
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc[2].table, VLC_BITS, VLC_DEPTH);
|
||||
GET_VLC(code, bits, gb, vlc[2].table, 7, 2);
|
||||
|
||||
pred[2] += code;
|
||||
dst[2] = pred[2];
|
||||
|
||||
/* Blue */
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc[3].table, VLC_BITS, VLC_DEPTH);
|
||||
GET_VLC(code, bits, gb, vlc[3].table, 7, 2);
|
||||
|
||||
pred[3] += code;
|
||||
dst[3] = pred[3];
|
||||
@@ -181,7 +166,7 @@ static int read_rgb24_component_line(CLLCContext *ctx, GetBitContext *gb,
|
||||
/* Simultaneously read and restore the line */
|
||||
for (i = 0; i < ctx->avctx->width; i++) {
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc->table, VLC_BITS, VLC_DEPTH);
|
||||
GET_VLC(code, bits, gb, vlc->table, 7, 2);
|
||||
|
||||
pred += code;
|
||||
dst[0] = pred;
|
||||
@@ -210,7 +195,7 @@ static int read_yuv_component_line(CLLCContext *ctx, GetBitContext *gb,
|
||||
/* Simultaneously read and restore the line */
|
||||
for (i = 0; i < ctx->avctx->width >> is_chroma; i++) {
|
||||
UPDATE_CACHE(bits, gb);
|
||||
GET_VLC(code, bits, gb, vlc->table, VLC_BITS, VLC_DEPTH);
|
||||
GET_VLC(code, bits, gb, vlc->table, 7, 2);
|
||||
|
||||
pred += code;
|
||||
outbuf[i] = pred;
|
||||
|
||||
+4
-5
@@ -41,6 +41,8 @@ int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
|
||||
{
|
||||
uint32_t mrk;
|
||||
int i, tmp;
|
||||
const uint16_t *ssrc = (const uint16_t *) src;
|
||||
uint16_t *sdst = (uint16_t *) dst;
|
||||
PutBitContext pb;
|
||||
|
||||
if ((unsigned) src_size > (unsigned) max_size)
|
||||
@@ -52,11 +54,8 @@ int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst,
|
||||
memcpy(dst, src, src_size);
|
||||
return src_size;
|
||||
case DCA_SYNCWORD_CORE_LE:
|
||||
for (i = 0; i < (src_size + 1) >> 1; i++) {
|
||||
AV_WB16(dst, AV_RL16(src));
|
||||
src += 2;
|
||||
dst += 2;
|
||||
}
|
||||
for (i = 0; i < (src_size + 1) >> 1; i++)
|
||||
*sdst++ = av_bswap16(*ssrc++);
|
||||
return src_size;
|
||||
case DCA_SYNCWORD_CORE_14B_BE:
|
||||
case DCA_SYNCWORD_CORE_14B_LE:
|
||||
|
||||
+2
-23
@@ -38,7 +38,7 @@
|
||||
|
||||
#define DDPF_FOURCC (1 << 2)
|
||||
#define DDPF_PALETTE (1 << 5)
|
||||
#define DDPF_NORMALMAP (1U << 31)
|
||||
#define DDPF_NORMALMAP (1 << 31)
|
||||
|
||||
enum DDSPostProc {
|
||||
DDS_NONE = 0,
|
||||
@@ -141,12 +141,6 @@ static int parse_pixel_format(AVCodecContext *avctx)
|
||||
normal_map = flags & DDPF_NORMALMAP;
|
||||
fourcc = bytestream2_get_le32(gbc);
|
||||
|
||||
if (ctx->compressed && ctx->paletted) {
|
||||
av_log(avctx, AV_LOG_WARNING,
|
||||
"Disabling invalid palette flag for compressed dds.\n");
|
||||
ctx->paletted = 0;
|
||||
}
|
||||
|
||||
bpp = bytestream2_get_le32(gbc); // rgbbitcount
|
||||
r = bytestream2_get_le32(gbc); // rbitmask
|
||||
g = bytestream2_get_le32(gbc); // gbitmask
|
||||
@@ -648,18 +642,9 @@ static int dds_decode(AVCodecContext *avctx, void *data,
|
||||
return ret;
|
||||
|
||||
if (ctx->compressed) {
|
||||
int size = (avctx->coded_height / TEXTURE_BLOCK_H) *
|
||||
(avctx->coded_width / TEXTURE_BLOCK_W) * ctx->tex_ratio;
|
||||
ctx->slice_count = av_clip(avctx->thread_count, 1,
|
||||
avctx->coded_height / TEXTURE_BLOCK_H);
|
||||
|
||||
if (bytestream2_get_bytes_left(gbc) < size) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Compressed Buffer is too small (%d < %d).\n",
|
||||
bytestream2_get_bytes_left(gbc), size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/* Use the decompress function on the texture, one block per thread. */
|
||||
ctx->tex_data = gbc->buffer;
|
||||
avctx->execute2(avctx, decompress_texture_thread, frame, NULL, ctx->slice_count);
|
||||
@@ -675,18 +660,12 @@ static int dds_decode(AVCodecContext *avctx, void *data,
|
||||
(frame->data[1][2+i*4]<<0)+
|
||||
(frame->data[1][1+i*4]<<8)+
|
||||
(frame->data[1][0+i*4]<<16)+
|
||||
((unsigned)frame->data[1][3+i*4]<<24)
|
||||
(frame->data[1][3+i*4]<<24)
|
||||
);
|
||||
|
||||
frame->palette_has_changed = 1;
|
||||
}
|
||||
|
||||
if (bytestream2_get_bytes_left(gbc) < frame->height * linesize) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Buffer is too small (%d < %d).\n",
|
||||
bytestream2_get_bytes_left(gbc), frame->height * linesize);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
av_image_copy_plane(frame->data[0], frame->linesize[0],
|
||||
gbc->buffer, linesize,
|
||||
linesize, frame->height);
|
||||
|
||||
+3
-4
@@ -67,8 +67,7 @@ static int decode_tsw1(GetByteContext *gb, uint8_t *frame, int width, int height
|
||||
const uint8_t *frame_start = frame;
|
||||
const uint8_t *frame_end = frame + width * height;
|
||||
int mask = 0x10000, bitbuf = 0;
|
||||
int v, count;
|
||||
unsigned segments;
|
||||
int v, count, segments;
|
||||
unsigned offset;
|
||||
|
||||
segments = bytestream2_get_le32(gb);
|
||||
@@ -176,7 +175,7 @@ static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame += v;
|
||||
} else {
|
||||
if (frame_end - frame < width + 4)
|
||||
if (frame_end - frame < width + 3)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame[0] = frame[1] =
|
||||
frame[width] = frame[width + 1] = bytestream2_get_byte(gb);
|
||||
@@ -250,7 +249,7 @@ static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height
|
||||
segments = bytestream2_get_le16u(gb);
|
||||
while ((segments & 0xC000) == 0xC000) {
|
||||
unsigned skip_lines = -(int16_t)segments;
|
||||
int64_t delta = -((int16_t)segments * (int64_t)width);
|
||||
unsigned delta = -((int16_t)segments * width);
|
||||
if (frame_end - frame <= delta || y + lines + skip_lines > height)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame += delta;
|
||||
|
||||
@@ -100,12 +100,10 @@ typedef struct DiracParseUnit {
|
||||
static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
|
||||
int offset)
|
||||
{
|
||||
int8_t *start;
|
||||
|
||||
if (offset < 0 || pc->index - 13 < offset)
|
||||
uint8_t *start = pc->buffer + offset;
|
||||
uint8_t *end = pc->buffer + pc->index;
|
||||
if (start < pc->buffer || (start + 13 > end))
|
||||
return 0;
|
||||
|
||||
start = pc->buffer + offset;
|
||||
pu->pu_type = start[4];
|
||||
|
||||
pu->next_pu_offset = AV_RB32(start + 5);
|
||||
@@ -114,15 +112,6 @@ static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc,
|
||||
if (pu->pu_type == 0x10 && pu->next_pu_offset == 0)
|
||||
pu->next_pu_offset = 13;
|
||||
|
||||
if (pu->next_pu_offset && pu->next_pu_offset < 13) {
|
||||
av_log(NULL, AV_LOG_ERROR, "next_pu_offset %d is invalid\n", pu->next_pu_offset);
|
||||
return 0;
|
||||
}
|
||||
if (pu->prev_pu_offset && pu->prev_pu_offset < 13) {
|
||||
av_log(NULL, AV_LOG_ERROR, "prev_pu_offset %d is invalid\n", pu->prev_pu_offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -134,7 +123,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
DiracParseContext *pc = s->priv_data;
|
||||
|
||||
if (pc->overread_index) {
|
||||
memmove(pc->buffer, pc->buffer + pc->overread_index,
|
||||
memcpy(pc->buffer, pc->buffer + pc->overread_index,
|
||||
pc->index - pc->overread_index);
|
||||
pc->index -= pc->overread_index;
|
||||
pc->overread_index = 0;
|
||||
@@ -201,7 +190,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
/* Get the picture number to set the pts and dts*/
|
||||
if (parse_timing_info && pu1.prev_pu_offset >= 13) {
|
||||
if (parse_timing_info) {
|
||||
uint8_t *cur_pu = pc->buffer +
|
||||
pc->index - 13 - pu1.prev_pu_offset;
|
||||
int pts = AV_RB32(cur_pu + 13);
|
||||
|
||||
+2
-11
@@ -1031,13 +1031,6 @@ static int dirac_unpack_idwt_params(DiracContext *s)
|
||||
/*[DIRAC_STD] 11.3.4 Slice coding Parameters (low delay syntax only). slice_parameters() */
|
||||
s->lowdelay.num_x = svq3_get_ue_golomb(gb);
|
||||
s->lowdelay.num_y = svq3_get_ue_golomb(gb);
|
||||
if (s->lowdelay.num_x * s->lowdelay.num_y == 0 ||
|
||||
s->lowdelay.num_x * (uint64_t)s->lowdelay.num_y > INT_MAX) {
|
||||
av_log(s->avctx,AV_LOG_ERROR,"Invalid numx/y\n");
|
||||
s->lowdelay.num_x = s->lowdelay.num_y = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
s->lowdelay.bytes.num = svq3_get_ue_golomb(gb);
|
||||
s->lowdelay.bytes.den = svq3_get_ue_golomb(gb);
|
||||
|
||||
@@ -1767,9 +1760,7 @@ static int dirac_decode_picture_header(DiracContext *s)
|
||||
for (j = 0; j < MAX_FRAMES; j++)
|
||||
if (!s->all_frames[j].avframe->data[0]) {
|
||||
s->ref_pics[i] = &s->all_frames[j];
|
||||
ret = get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1833,9 +1824,9 @@ static int get_delayed_pic(DiracContext *s, AVFrame *picture, int *got_frame)
|
||||
|
||||
if (out) {
|
||||
out->reference ^= DELAYED_PIC_REF;
|
||||
*got_frame = 1;
|
||||
if((ret = av_frame_ref(picture, out->avframe)) < 0)
|
||||
return ret;
|
||||
*got_frame = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+72
-31
@@ -48,7 +48,7 @@ static const uint8_t dnxhd_1235_chroma_weight[] = {
|
||||
90, 90, 85, 79, 73, 73, 73, 73,
|
||||
};
|
||||
|
||||
/* Used in CID 1237, 1253, 1259 */
|
||||
/* Used in CID 1237, 1253 */
|
||||
static const uint8_t dnxhd_1237_luma_weight[] = {
|
||||
0, 32, 33, 34, 34, 36, 37, 36,
|
||||
36, 37, 38, 38, 38, 39, 41, 44,
|
||||
@@ -60,7 +60,7 @@ static const uint8_t dnxhd_1237_luma_weight[] = {
|
||||
97, 100, 104, 102, 98, 98, 99, 99,
|
||||
};
|
||||
|
||||
/* Used in CID 1237, 1253, 1259 */
|
||||
/* Used in CID 1237, 1253 */
|
||||
static const uint8_t dnxhd_1237_chroma_weight[] = {
|
||||
0, 32, 36, 39, 39, 38, 39, 41,
|
||||
45, 51, 57, 58, 53, 48, 47, 51,
|
||||
@@ -204,7 +204,6 @@ static const uint8_t dnxhd_1251_chroma_weight[] = {
|
||||
61, 59, 59, 59, 61, 62, 62, 62,
|
||||
};
|
||||
|
||||
/* Used in CID 1252, 1258 */
|
||||
static const uint8_t dnxhd_1252_luma_weight[] = {
|
||||
0, 32, 34, 35, 36, 36, 36, 37,
|
||||
36, 37, 39, 40, 41, 40, 40, 40,
|
||||
@@ -215,8 +214,6 @@ static const uint8_t dnxhd_1252_luma_weight[] = {
|
||||
71, 82, 90, 90, 88, 87, 90, 95,
|
||||
100, 107, 103, 97, 95, 93, 99, 99,
|
||||
};
|
||||
|
||||
/* Used in CID 1252, 1258 */
|
||||
static const uint8_t dnxhd_1252_chroma_weight[] = {
|
||||
0, 32, 35, 36, 37, 37, 38, 40,
|
||||
42, 46, 49, 50, 50, 49, 49, 53,
|
||||
@@ -229,36 +226,80 @@ static const uint8_t dnxhd_1252_chroma_weight[] = {
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1256_chroma_weight[] = {
|
||||
0, 32, 32, 32, 32, 32, 32, 32,
|
||||
32, 32, 32, 32, 32, 32, 32, 32,
|
||||
32, 32, 32, 32, 32, 32, 37, 32,
|
||||
32, 32, 32, 32, 33, 32, 32, 32,
|
||||
32, 32, 33, 34, 37, 36, 32, 32,
|
||||
32, 33, 34, 37, 36, 34, 35, 36,
|
||||
39, 44, 40, 40, 39, 39, 44, 43,
|
||||
43, 51, 56, 50, 49, 60, 61, 70,
|
||||
0, 32, 32, 32, 32, 32, 32, 33,
|
||||
32, 32, 32, 32, 32, 32, 32, 34,
|
||||
32, 32, 32, 32, 32, 32, 33, 37,
|
||||
32, 32, 32, 32, 32, 32, 36, 39,
|
||||
32, 32, 32, 32, 32, 34, 39, 44,
|
||||
32, 37, 32, 32, 35, 40, 43, 49,
|
||||
32, 33, 36, 36, 40, 43, 50, 60,
|
||||
34, 37, 39, 44, 51, 56, 61, 70,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1258_luma_weight[] = {
|
||||
0, 32, 36, 36, 40, 40, 55, 60,
|
||||
34, 36, 37, 40, 41, 48, 57, 82,
|
||||
35, 36, 41, 41, 46, 52, 73, 82,
|
||||
37, 40, 42, 45, 50, 65, 80, 87,
|
||||
39, 41, 44, 49, 62, 78, 88, 90,
|
||||
41, 44, 49, 58, 73, 90, 95, 95,
|
||||
43, 52, 55, 68, 90, 100, 97, 93,
|
||||
52, 53, 71, 82, 107, 103, 99, 99,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1258_chroma_weight[] = {
|
||||
0, 32, 37, 38, 49, 53, 65, 66,
|
||||
35, 37, 40, 49, 56, 64, 65, 82,
|
||||
36, 42, 50, 56, 64, 67, 73, 85,
|
||||
46, 50, 57, 63, 71, 72, 89, 87,
|
||||
49, 58, 65, 72, 78, 88, 88, 90,
|
||||
60, 64, 74, 81, 84, 90, 95, 134,
|
||||
62, 74, 77, 80, 90, 114, 129, 125,
|
||||
74, 74, 90, 100, 128, 125, 116, 116,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1259_luma_weight[] = {
|
||||
0, 32, 36, 37, 41, 44, 54, 60,
|
||||
33, 34, 36, 39, 43, 51, 62, 78,
|
||||
34, 36, 38, 41, 49, 59, 73, 79,
|
||||
37, 38, 40, 47, 55, 66, 80, 95,
|
||||
38, 41, 46, 54, 63, 79, 93, 96,
|
||||
46, 47, 56, 64, 78, 90, 97, 98,
|
||||
49, 58, 66, 78, 89, 97, 102, 98,
|
||||
61, 65, 82, 87, 100, 104, 99, 99,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1259_chroma_weight[] = {
|
||||
0, 32, 38, 39, 47, 51, 77, 83,
|
||||
36, 39, 41, 48, 55, 74, 85, 95,
|
||||
39, 45, 53, 58, 72, 83, 105, 89,
|
||||
51, 58, 66, 73, 82, 109, 92, 95,
|
||||
57, 75, 78, 89, 105, 95, 93, 96,
|
||||
81, 82, 99, 99, 94, 90, 97, 98,
|
||||
83, 96, 97, 93, 89, 97, 102, 98,
|
||||
90, 94, 92, 88, 100, 104, 99, 99,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1260_luma_weight[] = {
|
||||
0, 32, 33, 34, 36, 37, 37, 36,
|
||||
34, 33, 34, 35, 37, 38, 40, 41,
|
||||
40, 39, 38, 37, 34, 33, 34, 37,
|
||||
40, 44, 48, 52, 53, 49, 47, 45,
|
||||
42, 38, 36, 36, 38, 41, 43, 44,
|
||||
46, 49, 52, 54, 54, 49, 44, 44,
|
||||
44, 47, 51, 51, 52, 51, 48, 50,
|
||||
52, 53, 53, 50, 50, 54, 54, 54,
|
||||
0, 32, 37, 37, 40, 41, 52, 53,
|
||||
33, 36, 36, 38, 40, 48, 49, 52,
|
||||
34, 34, 37, 39, 44, 47, 49, 54,
|
||||
33, 35, 38, 40, 45, 46, 54, 51,
|
||||
34, 37, 37, 42, 44, 49, 52, 48,
|
||||
34, 34, 38, 43, 44, 51, 50, 50,
|
||||
33, 36, 41, 44, 51, 52, 50, 54,
|
||||
36, 38, 44, 47, 53, 53, 54, 54,
|
||||
};
|
||||
|
||||
static const uint8_t dnxhd_1260_chroma_weight[] = {
|
||||
0, 32, 34, 38, 42, 40, 38, 36,
|
||||
35, 35, 38, 42, 43, 43, 42, 40,
|
||||
38, 39, 43, 43, 42, 41, 43, 43,
|
||||
42, 44, 46, 45, 45, 46, 47, 46,
|
||||
44, 44, 45, 46, 46, 46, 50, 50,
|
||||
47, 47, 49, 49, 49, 49, 51, 53,
|
||||
51, 49, 53, 57, 56, 52, 50, 52,
|
||||
56, 56, 53, 53, 53, 54, 58, 58,
|
||||
0, 32, 40, 38, 42, 40, 45, 45,
|
||||
34, 42, 36, 43, 38, 46, 46, 49,
|
||||
38, 35, 43, 39, 44, 47, 47, 49,
|
||||
35, 42, 43, 42, 46, 47, 49, 52,
|
||||
38, 43, 43, 44, 50, 49, 56, 50,
|
||||
42, 43, 44, 50, 51, 57, 52, 53,
|
||||
41, 45, 46, 53, 53, 56, 53, 54,
|
||||
46, 46, 51, 49, 56, 53, 58, 58,
|
||||
};
|
||||
|
||||
/* Used in CID 1235, 1241, 1250, 1256 */
|
||||
@@ -1049,14 +1090,14 @@ const CIDEntry ff_dnxhd_cid_table[] = {
|
||||
{ 350, 390, 440, 730, 880 },
|
||||
{ { 24000, 1001 }, { 25, 1 }, { 30000, 1001 }, { 50, 1 }, { 60000, 1001 } } },
|
||||
{ 1258, 960, 720, 0, 212992, 212992, 4, 8, 5,
|
||||
dnxhd_1252_luma_weight, dnxhd_1252_chroma_weight,
|
||||
dnxhd_1258_luma_weight, dnxhd_1258_chroma_weight,
|
||||
dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
|
||||
dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level,
|
||||
dnxhd_1252_ac_flags,
|
||||
dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
|
||||
{ 42, 60, 75, 115 } },
|
||||
{ 1259, 1440, 1080, 0, 417792, 417792, 4, 8, 3,
|
||||
dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
|
||||
dnxhd_1259_luma_weight, dnxhd_1259_chroma_weight,
|
||||
dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
|
||||
dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
|
||||
dnxhd_1237_ac_flags,
|
||||
|
||||
+3
-12
@@ -349,12 +349,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
|
||||
uint8_t *dest_y, *dest_u, *dest_v;
|
||||
int dct_y_offset, dct_x_offset;
|
||||
int qscale, i;
|
||||
int interlaced_mb = 0;
|
||||
|
||||
if (ctx->cid_table->cid == 1260) {
|
||||
interlaced_mb = get_bits1(&ctx->gb);
|
||||
qscale = get_bits(&ctx->gb, 10);
|
||||
} else
|
||||
qscale = get_bits(&ctx->gb, 11);
|
||||
skip_bits1(&ctx->gb);
|
||||
|
||||
@@ -391,12 +386,8 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
|
||||
dest_u += frame->linesize[1];
|
||||
dest_v += frame->linesize[2];
|
||||
}
|
||||
if (interlaced_mb) {
|
||||
dct_linesize_luma <<= 1;
|
||||
dct_linesize_chroma <<= 1;
|
||||
}
|
||||
|
||||
dct_y_offset = interlaced_mb ? frame->linesize[0] : (dct_linesize_luma << 3);
|
||||
dct_y_offset = dct_linesize_luma << 3;
|
||||
dct_x_offset = 8 << shift1;
|
||||
if (!ctx->is_444) {
|
||||
ctx->idsp.idct_put(dest_y, dct_linesize_luma, ctx->blocks[0]);
|
||||
@@ -405,7 +396,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
|
||||
ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[5]);
|
||||
|
||||
if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
|
||||
dct_y_offset = interlaced_mb ? frame->linesize[1] : (dct_linesize_chroma << 3);
|
||||
dct_y_offset = dct_linesize_chroma << 3;
|
||||
ctx->idsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
|
||||
ctx->idsp.idct_put(dest_v, dct_linesize_chroma, ctx->blocks[3]);
|
||||
ctx->idsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[6]);
|
||||
@@ -418,7 +409,7 @@ static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
|
||||
ctx->idsp.idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->blocks[7]);
|
||||
|
||||
if (!(ctx->avctx->flags & AV_CODEC_FLAG_GRAY)) {
|
||||
dct_y_offset = interlaced_mb ? frame->linesize[1] : (dct_linesize_chroma << 3);
|
||||
dct_y_offset = dct_linesize_chroma << 3;
|
||||
ctx->idsp.idct_put(dest_u, dct_linesize_chroma, ctx->blocks[2]);
|
||||
ctx->idsp.idct_put(dest_u + dct_x_offset, dct_linesize_chroma, ctx->blocks[3]);
|
||||
ctx->idsp.idct_put(dest_u + dct_y_offset, dct_linesize_chroma, ctx->blocks[8]);
|
||||
|
||||
+2
-2
@@ -348,11 +348,11 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
// For 12 bit, ignore alpha
|
||||
if (elements == 4)
|
||||
buf += 2;
|
||||
// Jump to next aligned position
|
||||
buf += need_align;
|
||||
}
|
||||
for (i = 0; i < 3; i++)
|
||||
ptr[i] += p->linesize[i];
|
||||
// Jump to next aligned position
|
||||
buf += need_align;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
|
||||
+4
-4
@@ -33,7 +33,7 @@
|
||||
|
||||
#define DSS_SP_FRAME_SIZE 42
|
||||
#define DSS_SP_SAMPLE_COUNT (66 * SUBFRAMES)
|
||||
#define DSS_SP_FORMULA(a, b, c) ((int)((((a) * (1 << 15)) + (b) * (unsigned)(c)) + 0x4000) >> 15)
|
||||
#define DSS_SP_FORMULA(a, b, c) (((((a) << 15) + (b) * (c)) + 0x4000) >> 15)
|
||||
|
||||
typedef struct DssSpSubframe {
|
||||
int16_t gain;
|
||||
@@ -499,7 +499,7 @@ static void dss_sp_scale_vector(int32_t *vec, int bits, int size)
|
||||
vec[i] = vec[i] >> -bits;
|
||||
else
|
||||
for (i = 0; i < size; i++)
|
||||
vec[i] = vec[i] * (1 << bits);
|
||||
vec[i] = vec[i] << bits;
|
||||
}
|
||||
|
||||
static void dss_sp_update_buf(int32_t *hist, int32_t *vector)
|
||||
@@ -524,12 +524,12 @@ static void dss_sp_shift_sq_sub(const int32_t *filter_buf,
|
||||
tmp = dst[a] * filter_buf[0];
|
||||
|
||||
for (i = 14; i > 0; i--)
|
||||
tmp -= error_buf[i] * (unsigned)filter_buf[i];
|
||||
tmp -= error_buf[i] * filter_buf[i];
|
||||
|
||||
for (i = 14; i > 0; i--)
|
||||
error_buf[i] = error_buf[i - 1];
|
||||
|
||||
tmp = (int)(tmp + 4096U) >> 13;
|
||||
tmp = (tmp + 4096) >> 13;
|
||||
|
||||
error_buf[1] = tmp;
|
||||
|
||||
|
||||
+3
-11
@@ -24,7 +24,6 @@
|
||||
#include "bytestream.h"
|
||||
#include "internal.h"
|
||||
#include "libavutil/colorspace.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
#define DVBSUB_PAGE_SEGMENT 0x10
|
||||
@@ -811,7 +810,7 @@ static void compute_default_clut(AVPicture *frame, int w, int h)
|
||||
list_inv[ i ] = bestv;
|
||||
}
|
||||
|
||||
count = FFMAX(i - 1, 1);
|
||||
count = i - 1;
|
||||
for (i--; i>=0; i--) {
|
||||
int v = i*255/count;
|
||||
AV_WN32(frame->data[1] + 4*list_inv[i], RGBA(v/2,v,v/2,v));
|
||||
@@ -1206,9 +1205,9 @@ static int dvbsub_parse_clut_segment(AVCodecContext *avctx,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (depth & 0x80 && entry_id < 4)
|
||||
if (depth & 0x80)
|
||||
clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
|
||||
else if (depth & 0x40 && entry_id < 16)
|
||||
else if (depth & 0x40)
|
||||
clut->clut16[entry_id] = RGBA(r,g,b,255 - alpha);
|
||||
else if (depth & 0x20)
|
||||
clut->clut256[entry_id] = RGBA(r,g,b,255 - alpha);
|
||||
@@ -1231,7 +1230,6 @@ static int dvbsub_parse_region_segment(AVCodecContext *avctx,
|
||||
DVBSubObject *object;
|
||||
DVBSubObjectDisplay *display;
|
||||
int fill;
|
||||
int ret;
|
||||
|
||||
if (buf_size < 10)
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -1260,12 +1258,6 @@ static int dvbsub_parse_region_segment(AVCodecContext *avctx,
|
||||
region->height = AV_RB16(buf);
|
||||
buf += 2;
|
||||
|
||||
ret = av_image_check_size(region->width, region->height, 0, avctx);
|
||||
if (ret < 0) {
|
||||
region->width= region->height= 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (region->width * region->height != region->buf_size) {
|
||||
av_free(region->pbuf);
|
||||
|
||||
|
||||
+1
-1
@@ -347,7 +347,7 @@ retry:
|
||||
dct_mode * 22 * 64 +
|
||||
(quant + ff_dv_quant_offset[class1]) * 64];
|
||||
}
|
||||
dc = dc * 4;
|
||||
dc = dc << 2;
|
||||
/* convert to unsigned because 128 is not added in the
|
||||
* standard IDCT */
|
||||
dc += 1024;
|
||||
|
||||
@@ -60,7 +60,7 @@ static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *
|
||||
cb = *ycbcr++;
|
||||
YUV_TO_RGB1_CCIR(cb, cr);
|
||||
YUV_TO_RGB2_CCIR(r, g, b, y);
|
||||
*rgba++ = ((unsigned)*alpha++ << 24) | (r << 16) | (g << 8) | b;
|
||||
*rgba++ = (*alpha++ << 24) | (r << 16) | (g << 8) | b;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,16 +185,16 @@ static void guess_palette(DVDSubContext* ctx,
|
||||
for(i = 0; i < 4; i++) {
|
||||
if (alpha[i] != 0) {
|
||||
if (!color_used[colormap[i]]) {
|
||||
level = level_map[nb_opaque_colors - 1][j];
|
||||
level = level_map[nb_opaque_colors][j];
|
||||
r = (((subtitle_color >> 16) & 0xff) * level) >> 8;
|
||||
g = (((subtitle_color >> 8) & 0xff) * level) >> 8;
|
||||
b = (((subtitle_color >> 0) & 0xff) * level) >> 8;
|
||||
rgba_palette[i] = b | (g << 8) | (r << 16) | ((alpha[i] * 17U) << 24);
|
||||
rgba_palette[i] = b | (g << 8) | (r << 16) | ((alpha[i] * 17) << 24);
|
||||
color_used[colormap[i]] = (i + 1);
|
||||
j++;
|
||||
} else {
|
||||
rgba_palette[i] = (rgba_palette[color_used[colormap[i]] - 1] & 0x00ffffff) |
|
||||
((alpha[i] * 17U) << 24);
|
||||
((alpha[i] * 17) << 24);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -346,7 +346,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
||||
}
|
||||
}
|
||||
the_end:
|
||||
if (offset1 >= 0 && offset2 >= 0) {
|
||||
if (offset1 >= 0) {
|
||||
int w, h;
|
||||
uint8_t *bitmap;
|
||||
|
||||
@@ -516,8 +516,7 @@ static int append_to_cached_buf(AVCodecContext *avctx,
|
||||
{
|
||||
DVDSubContext *ctx = avctx->priv_data;
|
||||
|
||||
av_assert0(buf_size >= 0 && ctx->buf_size <= sizeof(ctx->buf));
|
||||
if (buf_size >= sizeof(ctx->buf) - ctx->buf_size) {
|
||||
if (ctx->buf_size >= sizeof(ctx->buf) - buf_size) {
|
||||
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
|
||||
"too large SPU packets aborted.\n");
|
||||
ctx->buf_size = 0;
|
||||
|
||||
+2
-2
@@ -65,7 +65,7 @@ static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,
|
||||
uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
|
||||
int ret;
|
||||
|
||||
if (src_size < FFALIGN(avctx->width, 4) * FFALIGN(avctx->height, 4) * 9LL / 8) {
|
||||
if (src_size < avctx->width * avctx->height * 9LL / 8) {
|
||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
|
||||
uint8_t *Y1, *Y2, *U, *V;
|
||||
int ret;
|
||||
|
||||
if (src_size < FFALIGN(avctx->width, 2) * FFALIGN(avctx->height, 2) * 3LL / 2) {
|
||||
if (src_size < avctx->width * avctx->height * 3LL / 2) {
|
||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
|
||||
/* Vector Quantization */
|
||||
int v = get_bits(gbc, bits);
|
||||
for (blk = 0; blk < 6; blk++) {
|
||||
s->pre_mantissa[ch][bin][blk] = ff_eac3_mantissa_vq[hebap][v][blk] * (1 << 8);
|
||||
s->pre_mantissa[ch][bin][blk] = ff_eac3_mantissa_vq[hebap][v][blk] << 8;
|
||||
}
|
||||
} else {
|
||||
/* Gain Adaptive Quantization */
|
||||
@@ -271,16 +271,16 @@ static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
|
||||
int b;
|
||||
int mbits = bits - (2 - log_gain);
|
||||
mant = get_sbits(gbc, mbits);
|
||||
mant = ((unsigned)mant) << (23 - (mbits - 1));
|
||||
mant <<= (23 - (mbits - 1));
|
||||
/* remap mantissa value to correct for asymmetric quantization */
|
||||
if (mant >= 0)
|
||||
b = 1 << (23 - log_gain);
|
||||
else
|
||||
b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] * (1 << 8);
|
||||
b = ff_eac3_gaq_remap_2_4_b[hebap-8][log_gain-1] << 8;
|
||||
mant += ((ff_eac3_gaq_remap_2_4_a[hebap-8][log_gain-1] * (int64_t)mant) >> 15) + b;
|
||||
} else {
|
||||
/* small mantissa, no GAQ, or Gk=1 */
|
||||
mant *= (1 << 24 - bits);
|
||||
mant <<= 24 - bits;
|
||||
if (!log_gain) {
|
||||
/* remap mantissa value for no GAQ or Gk=1 */
|
||||
mant += (ff_eac3_gaq_remap_1[hebap-8] * (int64_t)mant) >> 15;
|
||||
|
||||
+1
-1
@@ -284,7 +284,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
|
||||
if (avctx->width != width || avctx->height != height) {
|
||||
av_frame_unref(s->last_frame);
|
||||
if((width * (int64_t)height)/2048*7 > bytestream2_get_bytes_left(&gb))
|
||||
if((width * height)/2048*7 > bytestream2_get_bytes_left(&gb))
|
||||
return AVERROR_INVALIDDATA;
|
||||
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
|
||||
return ret;
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ static inline void tqi_idct_put(TqiContext *t, AVFrame *frame, int16_t (*block)[
|
||||
|
||||
static void tqi_calculate_qtable(MpegEncContext *s, int quant)
|
||||
{
|
||||
const int64_t qscale = (215 - 2*quant)*5;
|
||||
const int qscale = (215 - 2*quant)*5;
|
||||
int i;
|
||||
s->intra_matrix[0] = (ff_inv_aanscales[0]*ff_mpeg1_default_intra_matrix[0])>>11;
|
||||
for(i=1; i<64; i++)
|
||||
|
||||
@@ -381,19 +381,14 @@ static void guess_mv(ERContext *s)
|
||||
#define MV_UNCHANGED 1
|
||||
const int mb_stride = s->mb_stride;
|
||||
const int mb_width = s->mb_width;
|
||||
int mb_height = s->mb_height;
|
||||
const int mb_height = s->mb_height;
|
||||
int i, depth, num_avail;
|
||||
int mb_x, mb_y, mot_step, mot_stride;
|
||||
|
||||
if (s->last_pic.f && s->last_pic.f->data[0])
|
||||
mb_height = FFMIN(mb_height, (s->last_pic.f->height+15)>>4);
|
||||
if (s->next_pic.f && s->next_pic.f->data[0])
|
||||
mb_height = FFMIN(mb_height, (s->next_pic.f->height+15)>>4);
|
||||
|
||||
set_mv_strides(s, &mot_step, &mot_stride);
|
||||
|
||||
num_avail = 0;
|
||||
for (i = 0; i < mb_width * mb_height; i++) {
|
||||
for (i = 0; i < s->mb_num; i++) {
|
||||
const int mb_xy = s->mb_index2xy[i];
|
||||
int f = 0;
|
||||
int error = s->error_status_table[mb_xy];
|
||||
@@ -418,7 +413,7 @@ static void guess_mv(ERContext *s)
|
||||
|
||||
if ((!(s->avctx->error_concealment&FF_EC_GUESS_MVS)) ||
|
||||
num_avail <= mb_width / 2) {
|
||||
for (mb_y = 0; mb_y < mb_height; mb_y++) {
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
|
||||
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||
const int mb_xy = mb_x + mb_y * s->mb_stride;
|
||||
int mv_dir = (s->last_pic.f && s->last_pic.f->data[0]) ? MV_DIR_FORWARD : MV_DIR_BACKWARD;
|
||||
@@ -447,7 +442,7 @@ static void guess_mv(ERContext *s)
|
||||
int score_sum = 0;
|
||||
|
||||
changed = 0;
|
||||
for (mb_y = 0; mb_y < mb_height; mb_y++) {
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
|
||||
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||
const int mb_xy = mb_x + mb_y * s->mb_stride;
|
||||
int mv_predictor[8][2] = { { 0 } };
|
||||
@@ -680,7 +675,7 @@ skip_last_mv:
|
||||
if (none_left)
|
||||
return;
|
||||
|
||||
for (i = 0; i < mb_width * mb_height; i++) {
|
||||
for (i = 0; i < s->mb_num; i++) {
|
||||
int mb_xy = s->mb_index2xy[i];
|
||||
if (fixed[mb_xy])
|
||||
fixed[mb_xy] = MV_FROZEN;
|
||||
|
||||
@@ -250,10 +250,6 @@ static int escape124_decode_frame(AVCodecContext *avctx,
|
||||
// This codebook can be cut off at places other than
|
||||
// powers of 2, leaving some of the entries undefined.
|
||||
cb_size = get_bits_long(&gb, 20);
|
||||
if (!cb_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid codebook size 0.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
cb_depth = av_log2(cb_size - 1) + 1;
|
||||
} else {
|
||||
cb_depth = get_bits(&gb, 4);
|
||||
|
||||
+7
-7
@@ -184,9 +184,9 @@ static union av_intfloat32 exr_half2float(uint16_t hf)
|
||||
*
|
||||
* @return normalized 16-bit unsigned int
|
||||
*/
|
||||
static inline uint16_t exr_flt2uint(int32_t v)
|
||||
static inline uint16_t exr_flt2uint(uint32_t v)
|
||||
{
|
||||
int32_t exp = v >> 23;
|
||||
unsigned int exp = v >> 23;
|
||||
// "HACK": negative values result in exp< 0, so clipping them to 0
|
||||
// is also handled by this condition, avoids explicit check for sign bit.
|
||||
if (exp <= 127 + 7 - 24) // we would shift out all bits anyway
|
||||
@@ -459,7 +459,7 @@ static int huf_build_dec_table(const uint64_t *hcode, int im,
|
||||
lc += 8; \
|
||||
}
|
||||
|
||||
#define get_code(po, rlc, c, lc, gb, out, oe, outb) \
|
||||
#define get_code(po, rlc, c, lc, gb, out, oe) \
|
||||
{ \
|
||||
if (po == rlc) { \
|
||||
if (lc < 8) \
|
||||
@@ -468,7 +468,7 @@ static int huf_build_dec_table(const uint64_t *hcode, int im,
|
||||
\
|
||||
cs = c >> lc; \
|
||||
\
|
||||
if (out + cs > oe || out == outb) \
|
||||
if (out + cs > oe) \
|
||||
return AVERROR_INVALIDDATA; \
|
||||
\
|
||||
s = out[-1]; \
|
||||
@@ -501,7 +501,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
|
||||
|
||||
if (pl.len) {
|
||||
lc -= pl.len;
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe, outb);
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe);
|
||||
} else {
|
||||
int j;
|
||||
|
||||
@@ -518,7 +518,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
|
||||
if ((hcode[pl.p[j]] >> 6) ==
|
||||
((c >> (lc - l)) & ((1LL << l) - 1))) {
|
||||
lc -= l;
|
||||
get_code(pl.p[j], rlc, c, lc, gb, out, oe, outb);
|
||||
get_code(pl.p[j], rlc, c, lc, gb, out, oe);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -539,7 +539,7 @@ static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
|
||||
|
||||
if (pl.len) {
|
||||
lc -= pl.len;
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe, outb);
|
||||
get_code(pl.lit, rlc, c, lc, gb, out, oe);
|
||||
} else {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -189,10 +189,6 @@ static int decode_uncompressed(AVCodecContext *avctx, GetBitContext *gb,
|
||||
*mode = !*mode;
|
||||
if (newmode != *mode) { //FIXME CHECK
|
||||
*(*runs)++ = 0;
|
||||
if (*runs >= runend) {
|
||||
av_log(avctx, AV_LOG_ERROR, "uncompressed run overrun\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
*mode = newmode;
|
||||
}
|
||||
return 0;
|
||||
|
||||
+12
-17
@@ -66,7 +66,7 @@ av_cold int ff_ffv1_common_init(AVCodecContext *avctx)
|
||||
|
||||
av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
|
||||
{
|
||||
int j, i;
|
||||
int j;
|
||||
|
||||
fs->plane_count = f->plane_count;
|
||||
fs->transparency = f->transparency;
|
||||
@@ -80,15 +80,10 @@ av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
|
||||
if (!p->state)
|
||||
return AVERROR(ENOMEM);
|
||||
} else {
|
||||
if (!p->vlc_state) {
|
||||
p->vlc_state = av_mallocz_array(p->context_count, sizeof(VlcState));
|
||||
if (!p->vlc_state)
|
||||
return AVERROR(ENOMEM);
|
||||
for (i = 0; i < p->context_count; i++) {
|
||||
p->vlc_state[i].error_sum = 4;
|
||||
p->vlc_state[i].count = 1;
|
||||
}
|
||||
}
|
||||
if (!p->vlc_state)
|
||||
p->vlc_state = av_malloc_array(p->context_count, sizeof(VlcState));
|
||||
if (!p->vlc_state)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +101,7 @@ av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
|
||||
av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
|
||||
{
|
||||
int i, ret;
|
||||
for (i = 0; i < f->max_slice_count; i++) {
|
||||
for (i = 0; i < f->slice_count; i++) {
|
||||
FFV1Context *fs = f->slice_context[i];
|
||||
if ((ret = ff_ffv1_init_slice_state(f, fs)) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -118,10 +113,10 @@ av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
|
||||
{
|
||||
int i;
|
||||
|
||||
f->max_slice_count = f->num_h_slices * f->num_v_slices;
|
||||
av_assert0(f->max_slice_count > 0);
|
||||
f->slice_count = f->num_h_slices * f->num_v_slices;
|
||||
av_assert0(f->slice_count > 0);
|
||||
|
||||
for (i = 0; i < f->max_slice_count; i++) {
|
||||
for (i = 0; i < f->slice_count; i++) {
|
||||
int sx = i % f->num_h_slices;
|
||||
int sy = i / f->num_h_slices;
|
||||
int sxs = f->avctx->width * sx / f->num_h_slices;
|
||||
@@ -215,7 +210,7 @@ av_cold int ff_ffv1_close(AVCodecContext *avctx)
|
||||
ff_thread_release_buffer(avctx, &s->last_picture);
|
||||
av_frame_free(&s->last_picture.f);
|
||||
|
||||
for (j = 0; j < s->max_slice_count; j++) {
|
||||
for (j = 0; j < s->slice_count; j++) {
|
||||
FFV1Context *fs = s->slice_context[j];
|
||||
for (i = 0; i < s->plane_count; i++) {
|
||||
PlaneContext *p = &fs->plane[i];
|
||||
@@ -229,14 +224,14 @@ av_cold int ff_ffv1_close(AVCodecContext *avctx)
|
||||
av_freep(&avctx->stats_out);
|
||||
for (j = 0; j < s->quant_table_count; j++) {
|
||||
av_freep(&s->initial_states[j]);
|
||||
for (i = 0; i < s->max_slice_count; i++) {
|
||||
for (i = 0; i < s->slice_count; i++) {
|
||||
FFV1Context *sf = s->slice_context[i];
|
||||
av_freep(&sf->rc_stat2[j]);
|
||||
}
|
||||
av_freep(&s->rc_stat2[j]);
|
||||
}
|
||||
|
||||
for (i = 0; i < s->max_slice_count; i++)
|
||||
for (i = 0; i < s->slice_count; i++)
|
||||
av_freep(&s->slice_context[i]);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -118,7 +118,6 @@ typedef struct FFV1Context {
|
||||
|
||||
struct FFV1Context *slice_context[MAX_SLICES];
|
||||
int slice_count;
|
||||
int max_slice_count;
|
||||
int num_v_slices;
|
||||
int num_h_slices;
|
||||
int slice_width;
|
||||
|
||||
+9
-30
@@ -45,14 +45,10 @@ static inline av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state,
|
||||
if (get_rac(c, state + 0))
|
||||
return 0;
|
||||
else {
|
||||
int i, e;
|
||||
unsigned a;
|
||||
int i, e, a;
|
||||
e = 0;
|
||||
while (get_rac(c, state + 1 + FFMIN(e, 9))) { // 1..10
|
||||
while (get_rac(c, state + 1 + FFMIN(e, 9))) // 1..10
|
||||
e++;
|
||||
if (e > 31)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
a = 1;
|
||||
for (i = e - 1; i >= 0; i--)
|
||||
@@ -306,7 +302,7 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
|
||||
for (i = 0; i < f->plane_count; i++) {
|
||||
PlaneContext * const p = &fs->plane[i];
|
||||
int idx = get_symbol(c, state, 0);
|
||||
if (idx >= (unsigned)f->quant_table_count) {
|
||||
if (idx > (unsigned)f->quant_table_count) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -409,7 +405,6 @@ static int decode_slice(AVCodecContext *c, void *arg)
|
||||
if (ff_ffv1_init_slice_state(f, fs) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
if (decode_slice_header(f, fs) < 0) {
|
||||
fs->slice_x = fs->slice_y = fs->slice_height = fs->slice_width = 0;
|
||||
fs->slice_damaged = 1;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -504,10 +499,7 @@ static int read_quant_tables(RangeCoder *c,
|
||||
int context_count = 1;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
int ret = read_quant_table(c, quant_table[i], context_count);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
context_count *= ret;
|
||||
context_count *= read_quant_table(c, quant_table[i], context_count);
|
||||
if (context_count > 32768U) {
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
@@ -570,11 +562,8 @@ static int read_extra_header(FFV1Context *f)
|
||||
}
|
||||
|
||||
f->quant_table_count = get_symbol(c, state, 0);
|
||||
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "quant table count %d is invalid\n", f->quant_table_count);
|
||||
f->quant_table_count = 0;
|
||||
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (i = 0; i < f->quant_table_count; i++) {
|
||||
f->context_count[i] = read_quant_tables(c, f->quant_tables[i]);
|
||||
@@ -786,7 +775,6 @@ static int read_header(FFV1Context *f)
|
||||
av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
f->slice_count = f->max_slice_count;
|
||||
} else if (f->version < 3) {
|
||||
f->slice_count = get_symbol(c, state, 0);
|
||||
} else {
|
||||
@@ -801,8 +789,8 @@ static int read_header(FFV1Context *f)
|
||||
p -= size + trailer;
|
||||
}
|
||||
}
|
||||
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0 || f->slice_count > f->max_slice_count) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid (max=%d)\n", f->slice_count, f->max_slice_count);
|
||||
if (f->slice_count > (unsigned)MAX_SLICES || f->slice_count <= 0) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "slice count %d is invalid\n", f->slice_count);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -944,7 +932,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
else v = buf_p - c->bytestream_start;
|
||||
if (buf_p - c->bytestream_start < v) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Slice pointer chain broken\n");
|
||||
ff_thread_report_progress(&f->picture, INT_MAX, 0);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
buf_p -= v;
|
||||
@@ -988,23 +975,16 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
||||
FFV1Context *fs = f->slice_context[i];
|
||||
int j;
|
||||
if (fs->slice_damaged && f->last_picture.f->data[0]) {
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||
const uint8_t *src[4];
|
||||
uint8_t *dst[4];
|
||||
ff_thread_await_progress(&f->last_picture, INT_MAX, 0);
|
||||
for (j = 0; j < desc->nb_components; j++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
int sh = (j == 1 || j == 2) ? f->chroma_h_shift : 0;
|
||||
int sv = (j == 1 || j == 2) ? f->chroma_v_shift : 0;
|
||||
dst[j] = p->data[j] + p->linesize[j] *
|
||||
(fs->slice_y >> sv) + (fs->slice_x >> sh);
|
||||
src[j] = f->last_picture.f->data[j] + f->last_picture.f->linesize[j] *
|
||||
(fs->slice_y >> sv) + (fs->slice_x >> sh);
|
||||
|
||||
}
|
||||
if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
|
||||
desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) {
|
||||
dst[1] = p->data[1];
|
||||
src[1] = f->last_picture.f->data[1];
|
||||
}
|
||||
av_image_copy(dst, p->linesize, src,
|
||||
f->last_picture.f->linesize,
|
||||
@@ -1036,7 +1016,6 @@ static int init_thread_copy(AVCodecContext *avctx)
|
||||
f->picture.f = NULL;
|
||||
f->last_picture.f = NULL;
|
||||
f->sample_buffer = NULL;
|
||||
f->max_slice_count = 0;
|
||||
f->slice_count = 0;
|
||||
|
||||
for (i = 0; i < f->quant_table_count; i++) {
|
||||
@@ -1112,7 +1091,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
|
||||
av_assert0(!fdst->sample_buffer);
|
||||
}
|
||||
|
||||
av_assert1(fdst->max_slice_count == fsrc->max_slice_count);
|
||||
av_assert1(fdst->slice_count == fsrc->slice_count);
|
||||
|
||||
|
||||
ff_thread_release_buffer(dst, &fdst->picture);
|
||||
|
||||
+9
-19
@@ -763,12 +763,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
s->colorspace = 1;
|
||||
s->transparency = 1;
|
||||
s->chroma_planes = 1;
|
||||
s->bits_per_raw_sample = 8;
|
||||
if (!avctx->bits_per_raw_sample)
|
||||
s->bits_per_raw_sample = 8;
|
||||
break;
|
||||
case AV_PIX_FMT_0RGB32:
|
||||
s->colorspace = 1;
|
||||
s->chroma_planes = 1;
|
||||
s->bits_per_raw_sample = 8;
|
||||
if (!avctx->bits_per_raw_sample)
|
||||
s->bits_per_raw_sample = 8;
|
||||
break;
|
||||
case AV_PIX_FMT_GBRP9:
|
||||
if (!avctx->bits_per_raw_sample)
|
||||
@@ -975,7 +977,6 @@ slices_ok:
|
||||
|
||||
if ((ret = ff_ffv1_init_slice_contexts(s)) < 0)
|
||||
return ret;
|
||||
s->slice_count = s->max_slice_count;
|
||||
if ((ret = ff_ffv1_init_slices_state(s)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -985,7 +986,7 @@ slices_ok:
|
||||
if (!avctx->stats_out)
|
||||
return AVERROR(ENOMEM);
|
||||
for (i = 0; i < s->quant_table_count; i++)
|
||||
for (j = 0; j < s->max_slice_count; j++) {
|
||||
for (j = 0; j < s->slice_count; j++) {
|
||||
FFV1Context *sf = s->slice_context[j];
|
||||
av_assert0(!sf->rc_stat2[i]);
|
||||
sf->rc_stat2[i] = av_mallocz(s->context_count[i] *
|
||||
@@ -1192,6 +1193,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
FFV1Context *f = avctx->priv_data;
|
||||
RangeCoder *const c = &f->slice_context[0]->c;
|
||||
AVFrame *const p = f->picture.f;
|
||||
int used_count = 0;
|
||||
uint8_t keystate = 128;
|
||||
uint8_t *buf_p;
|
||||
int i, ret;
|
||||
@@ -1208,7 +1210,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
for (i = 0; i < f->quant_table_count; i++)
|
||||
memset(f->rc_stat2[i], 0, f->context_count[i] * sizeof(*f->rc_stat2[i]));
|
||||
|
||||
av_assert0(f->slice_count == f->max_slice_count);
|
||||
for (j = 0; j < f->slice_count; j++) {
|
||||
FFV1Context *fs = f->slice_context[j];
|
||||
for (i = 0; i < 256; i++) {
|
||||
@@ -1247,11 +1248,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
if (f->version > 3)
|
||||
maxsize = AV_INPUT_BUFFER_MIN_SIZE + avctx->width*avctx->height*3LL*4;
|
||||
|
||||
if (maxsize > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - 32) {
|
||||
av_log(avctx, AV_LOG_WARNING, "Cannot allocate worst case packet size, the encoding could fail\n");
|
||||
maxsize = INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE - 32;
|
||||
}
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, maxsize, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -1281,17 +1277,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < f->slice_count; i++) {
|
||||
for (i = 1; i < f->slice_count; i++) {
|
||||
FFV1Context *fs = f->slice_context[i];
|
||||
uint8_t *start = pkt->data + pkt->size * (int64_t)i / f->slice_count;
|
||||
uint8_t *start = pkt->data + (pkt->size - used_count) * (int64_t)i / f->slice_count;
|
||||
int len = pkt->size / f->slice_count;
|
||||
if (i) {
|
||||
ff_init_range_encoder(&fs->c, start, len);
|
||||
} else {
|
||||
av_assert0(fs->c.bytestream_end >= fs->c.bytestream_start + len);
|
||||
av_assert0(fs->c.bytestream < fs->c.bytestream_start + len);
|
||||
fs->c.bytestream_end = fs->c.bytestream_start + len;
|
||||
}
|
||||
ff_init_range_encoder(&fs->c, start, len);
|
||||
}
|
||||
avctx->execute(avctx, encode_slice, &f->slice_context[0], NULL,
|
||||
f->slice_count, sizeof(void *));
|
||||
|
||||
+16
-16
@@ -88,22 +88,22 @@ static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd
|
||||
const int t1 = 27246 * blk[5 * step] - 18405 * blk[3 * step];
|
||||
const int t2 = 6393 * blk[7 * step] + 32139 * blk[1 * step];
|
||||
const int t3 = 6393 * blk[1 * step] - 32139 * blk[7 * step];
|
||||
const unsigned t4 = 5793U * (t2 + t0 + 0x800 >> 12);
|
||||
const unsigned t5 = 5793U * (t3 + t1 + 0x800 >> 12);
|
||||
const unsigned t6 = t2 - t0;
|
||||
const unsigned t7 = t3 - t1;
|
||||
const unsigned t8 = 17734 * blk[2 * step] - 42813 * blk[6 * step];
|
||||
const unsigned t9 = 17734 * blk[6 * step] + 42814 * blk[2 * step];
|
||||
const unsigned tA = (blk[0 * step] - blk[4 * step]) * 32768 + rnd;
|
||||
const unsigned tB = (blk[0 * step] + blk[4 * step]) * 32768 + rnd;
|
||||
blk[0 * step] = (int)( t4 + t9 + tB) >> shift;
|
||||
blk[1 * step] = (int)( t6 + t7 + t8 + tA) >> shift;
|
||||
blk[2 * step] = (int)( t6 - t7 - t8 + tA) >> shift;
|
||||
blk[3 * step] = (int)( t5 - t9 + tB) >> shift;
|
||||
blk[4 * step] = (int)( -t5 - t9 + tB) >> shift;
|
||||
blk[5 * step] = (int)(-(t6 - t7) - t8 + tA) >> shift;
|
||||
blk[6 * step] = (int)(-(t6 + t7) + t8 + tA) >> shift;
|
||||
blk[7 * step] = (int)( -t4 + t9 + tB) >> shift;
|
||||
const int t4 = 5793 * (t2 + t0 + 0x800 >> 12);
|
||||
const int t5 = 5793 * (t3 + t1 + 0x800 >> 12);
|
||||
const int t6 = t2 - t0;
|
||||
const int t7 = t3 - t1;
|
||||
const int t8 = 17734 * blk[2 * step] - 42813 * blk[6 * step];
|
||||
const int t9 = 17734 * blk[6 * step] + 42814 * blk[2 * step];
|
||||
const int tA = (blk[0 * step] - blk[4 * step] << 15) + rnd;
|
||||
const int tB = (blk[0 * step] + blk[4 * step] << 15) + rnd;
|
||||
blk[0 * step] = ( t4 + t9 + tB) >> shift;
|
||||
blk[1 * step] = ( t6 + t7 + t8 + tA) >> shift;
|
||||
blk[2 * step] = ( t6 - t7 - t8 + tA) >> shift;
|
||||
blk[3 * step] = ( t5 - t9 + tB) >> shift;
|
||||
blk[4 * step] = ( -t5 - t9 + tB) >> shift;
|
||||
blk[5 * step] = (-(t6 - t7) - t8 + tA) >> shift;
|
||||
blk[6 * step] = (-(t6 + t7) + t8 + tA) >> shift;
|
||||
blk[7 * step] = ( -t4 + t9 + tB) >> shift;
|
||||
}
|
||||
|
||||
static void fic_idct_put(uint8_t *dst, int stride, int16_t *block)
|
||||
|
||||
@@ -586,12 +586,10 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
temp = curr->next;
|
||||
av_freep(&curr->link_penalty);
|
||||
av_free(curr);
|
||||
fpc->nb_headers_buffered--;
|
||||
}
|
||||
fpc->headers = fpc->best_header->next;
|
||||
av_freep(&fpc->best_header->link_penalty);
|
||||
av_freep(&fpc->best_header);
|
||||
fpc->nb_headers_buffered--;
|
||||
}
|
||||
|
||||
/* Find and score new headers. */
|
||||
@@ -619,8 +617,8 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
|
||||
if (!av_fifo_space(fpc->fifo_buf) &&
|
||||
av_fifo_size(fpc->fifo_buf) / FLAC_AVG_FRAME_SIZE >
|
||||
fpc->nb_headers_buffered * 20) {
|
||||
/* There is less than one valid flac header buffered for 20 headers
|
||||
fpc->nb_headers_buffered * 10) {
|
||||
/* There is less than one valid flac header buffered for 10 headers
|
||||
* buffered. Therefore the fifo is most likely filled with invalid
|
||||
* data and the input is not a flac file. */
|
||||
goto handle_error;
|
||||
|
||||
@@ -201,12 +201,12 @@ static int get_metadata_size(const uint8_t *buf, int buf_size)
|
||||
buf += 4;
|
||||
do {
|
||||
if (buf_end - buf < 4)
|
||||
return AVERROR_INVALIDDATA;
|
||||
return 0;
|
||||
flac_parse_block_header(buf, &metadata_last, NULL, &metadata_size);
|
||||
buf += 4;
|
||||
if (buf_end - buf < metadata_size) {
|
||||
/* need more data in order to read the complete header */
|
||||
return AVERROR_INVALIDDATA;
|
||||
return 0;
|
||||
}
|
||||
buf += metadata_size;
|
||||
} while (!metadata_last);
|
||||
@@ -268,8 +268,7 @@ static int decode_subframe_fixed(FLACContext *s, int32_t *decoded,
|
||||
int pred_order, int bps)
|
||||
{
|
||||
const int blocksize = s->blocksize;
|
||||
unsigned av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d);
|
||||
int i;
|
||||
int av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d), i;
|
||||
int ret;
|
||||
|
||||
/* warm up samples */
|
||||
@@ -448,7 +447,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
|
||||
if (wasted) {
|
||||
int i;
|
||||
for (i = 0; i < s->blocksize; i++)
|
||||
decoded[i] = (unsigned)decoded[i] << wasted;
|
||||
decoded[i] <<= wasted;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -56,7 +56,7 @@ static void FUNC(flac_decorrelate_indep_c)(uint8_t **out, int32_t **in,
|
||||
|
||||
for (j = 0; j < len; j++)
|
||||
for (i = 0; i < channels; i++)
|
||||
S(samples, i, j) = (int)((unsigned)in[i][j] << shift);
|
||||
S(samples, i, j) = in[i][j] << shift;
|
||||
}
|
||||
|
||||
static void FUNC(flac_decorrelate_ls_c)(uint8_t **out, int32_t **in,
|
||||
|
||||
@@ -1021,7 +1021,7 @@ static int count_frame_header(FlacEncodeContext *s)
|
||||
count += 16;
|
||||
|
||||
/* explicit sample rate */
|
||||
count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12) * 2) * 8;
|
||||
count += ((s->sr_code[0] == 12) + (s->sr_code[0] > 12)) * 8;
|
||||
|
||||
/* frame header CRC-8 */
|
||||
count += 8;
|
||||
|
||||
@@ -413,10 +413,6 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
if (has_diff) {
|
||||
if (size < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "size too small for diff\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (!s->keyframe) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Inter frame without keyframe\n");
|
||||
@@ -444,10 +440,6 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int row = get_bits(&gb, 8);
|
||||
av_log(avctx, AV_LOG_DEBUG, "%dx%d zlibprime_curr %dx%d\n",
|
||||
i, j, col, row);
|
||||
if (size < 3) {
|
||||
av_log(avctx, AV_LOG_ERROR, "size too small for zlibprime_curr\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
size -= 2;
|
||||
avpriv_request_sample(avctx, "zlibprime_curr");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
|
||||
@@ -202,9 +202,6 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
|
||||
num_chunks = bytestream2_get_le16(&g2);
|
||||
bytestream2_skip(&g2, 8); /* skip padding */
|
||||
|
||||
if (frame_size < 16)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
frame_size -= 16;
|
||||
|
||||
/* iterate through the chunks */
|
||||
@@ -523,8 +520,6 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
|
||||
if (frame_size > buf_size)
|
||||
frame_size = buf_size;
|
||||
|
||||
if (frame_size < 16)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame_size -= 16;
|
||||
|
||||
/* iterate through the chunks */
|
||||
|
||||
+1
-6
@@ -631,8 +631,6 @@ static int epic_decode_run_length(ePICContext *dc, int x, int y, int tile_width,
|
||||
(NN != N) << 1 |
|
||||
(NNW != NW);
|
||||
WWneW = ff_els_decode_bit(&dc->els_ctx, &dc->W_ctx_rung[idx]);
|
||||
if (WWneW < 0)
|
||||
return WWneW;
|
||||
}
|
||||
|
||||
if (WWneW)
|
||||
@@ -839,13 +837,10 @@ static int epic_decode_tile(ePICContext *dc, uint8_t *out, int tile_height,
|
||||
if (y < 2 || x < 2 || x == tile_width - 1) {
|
||||
run = 1;
|
||||
got_pixel = epic_handle_edges(dc, x, y, curr_row, above_row, &pix);
|
||||
} else {
|
||||
} else
|
||||
got_pixel = epic_decode_run_length(dc, x, y, tile_width,
|
||||
curr_row, above_row,
|
||||
above2_row, &pix, &run);
|
||||
if (got_pixel < 0)
|
||||
return got_pixel;
|
||||
}
|
||||
|
||||
if (!got_pixel && !epic_predict_from_NW_NE(dc, x, y, run,
|
||||
tile_width, curr_row,
|
||||
|
||||
+4
-4
@@ -88,14 +88,14 @@ static inline void s_zero(int cur_diff, struct G722Band *band)
|
||||
ACCUM(3, band->diff_mem[2], 1);
|
||||
ACCUM(2, band->diff_mem[1], 1);
|
||||
ACCUM(1, band->diff_mem[0], 1);
|
||||
ACCUM(0, cur_diff * 2, 1);
|
||||
ACCUM(0, cur_diff << 1, 1);
|
||||
} else {
|
||||
ACCUM(5, band->diff_mem[4], 0);
|
||||
ACCUM(4, band->diff_mem[3], 0);
|
||||
ACCUM(3, band->diff_mem[2], 0);
|
||||
ACCUM(2, band->diff_mem[1], 0);
|
||||
ACCUM(1, band->diff_mem[0], 0);
|
||||
ACCUM(0, cur_diff * 2, 0);
|
||||
ACCUM(0, cur_diff << 1, 0);
|
||||
}
|
||||
#undef ACCUM
|
||||
band->s_zero = s_zero;
|
||||
@@ -119,14 +119,14 @@ static void do_adaptive_prediction(struct G722Band *band, const int cur_diff)
|
||||
band->part_reconst_mem[0] = cur_part_reconst;
|
||||
|
||||
band->pole_mem[1] = av_clip((sg[0] * av_clip(band->pole_mem[0], -8191, 8191) >> 5) +
|
||||
(sg[1] * 128) + (band->pole_mem[1] * 127 >> 7), -12288, 12288);
|
||||
(sg[1] << 7) + (band->pole_mem[1] * 127 >> 7), -12288, 12288);
|
||||
|
||||
limit = 15360 - band->pole_mem[1];
|
||||
band->pole_mem[0] = av_clip(-192 * sg[0] + (band->pole_mem[0] * 255 >> 8), -limit, limit);
|
||||
|
||||
s_zero(cur_diff, band);
|
||||
|
||||
cur_qtzd_reconst = av_clip_int16((band->s_predictor + cur_diff) * 2);
|
||||
cur_qtzd_reconst = av_clip_int16((band->s_predictor + cur_diff) << 1);
|
||||
band->s_predictor = av_clip_int16(band->s_zero +
|
||||
(band->pole_mem[0] * cur_qtzd_reconst >> 15) +
|
||||
(band->pole_mem[1] * band->prev_qtzd_reconst >> 15));
|
||||
|
||||
+3
-3
@@ -32,7 +32,7 @@
|
||||
|
||||
/**
|
||||
* G.726 11bit float.
|
||||
* G.726 Standard uses rather odd 11bit floating point arithmetic for
|
||||
* G.726 Standard uses rather odd 11bit floating point arithmentic for
|
||||
* numerous occasions. It's a mystery to me why they did it this way
|
||||
* instead of simply using 32bit integer arithmetic.
|
||||
*/
|
||||
@@ -206,7 +206,7 @@ static int16_t g726_decode(G726Context* c, int I)
|
||||
|
||||
if (I_sig) /* get the sign */
|
||||
dq = -dq;
|
||||
re_signal = (int16_t)(c->se + dq);
|
||||
re_signal = c->se + dq;
|
||||
|
||||
/* Update second order predictor coefficient A2 and A1 */
|
||||
pk0 = (c->sez + dq) ? sgn(c->sez + dq) : 0;
|
||||
@@ -269,7 +269,7 @@ static int16_t g726_decode(G726Context* c, int I)
|
||||
c->se += mult(i2f(c->a[i] >> 2, &f), &c->sr[i]);
|
||||
c->se >>= 1;
|
||||
|
||||
return av_clip(re_signal * 4, -0xffff, 0xffff);
|
||||
return av_clip(re_signal << 2, -0xffff, 0xffff);
|
||||
}
|
||||
|
||||
static av_cold int g726_reset(G726Context *c)
|
||||
|
||||
@@ -374,10 +374,6 @@ static inline uint64_t get_bits64(GetBitContext *s, int n)
|
||||
*/
|
||||
static inline int get_sbits_long(GetBitContext *s, int n)
|
||||
{
|
||||
// sign_extend(x, 0) is undefined
|
||||
if (!n)
|
||||
return 0;
|
||||
|
||||
return sign_extend(get_bits_long(s, n), n);
|
||||
}
|
||||
|
||||
|
||||
+2
-5
@@ -43,7 +43,6 @@ typedef struct GIFContext {
|
||||
const AVClass *class;
|
||||
LZWState *lzw;
|
||||
uint8_t *buf;
|
||||
int buf_size;
|
||||
AVFrame *last_frame;
|
||||
int flags;
|
||||
uint32_t palette[AVPALETTE_COUNT]; ///< local reference palette for !pal8
|
||||
@@ -175,7 +174,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
|
||||
|
||||
bytestream_put_byte(bytestream, 0x08);
|
||||
|
||||
ff_lzw_encode_init(s->lzw, s->buf, s->buf_size,
|
||||
ff_lzw_encode_init(s->lzw, s->buf, 2 * width * height,
|
||||
12, FF_LZW_GIF, put_bits);
|
||||
|
||||
ptr = buf + y_start*linesize + x_start;
|
||||
@@ -232,8 +231,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
s->transparent_index = -1;
|
||||
|
||||
s->lzw = av_mallocz(ff_lzw_encode_state_size);
|
||||
s->buf_size = avctx->width*avctx->height*2 + 1000;
|
||||
s->buf = av_malloc(s->buf_size);
|
||||
s->buf = av_malloc(avctx->width*avctx->height*2);
|
||||
s->tmpl = av_malloc(avctx->width);
|
||||
if (!s->tmpl || !s->buf || !s->lzw)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -323,7 +321,6 @@ static int gif_encode_close(AVCodecContext *avctx)
|
||||
|
||||
av_freep(&s->lzw);
|
||||
av_freep(&s->buf);
|
||||
s->buf_size = 0;
|
||||
av_frame_free(&s->last_frame);
|
||||
av_freep(&s->tmpl);
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ static inline int get_ue_golomb(GetBitContext *gb)
|
||||
int log = 2 * av_log2(buf) - 31;
|
||||
LAST_SKIP_BITS(re, gb, 32 - log);
|
||||
CLOSE_READER(re, gb);
|
||||
if (log < 7) {
|
||||
if (CONFIG_FTRAPV && log < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Invalid UE golomb code\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
+5
-48
@@ -1587,9 +1587,7 @@ again:
|
||||
#endif
|
||||
} else
|
||||
context_count++;
|
||||
} else
|
||||
sl->ref_count[0] = sl->ref_count[1] = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case NAL_DPA:
|
||||
case NAL_DPB:
|
||||
@@ -1654,8 +1652,8 @@ again:
|
||||
av_log(h->avctx, AV_LOG_ERROR, "decode_slice_header error\n");
|
||||
sl->ref_count[0] = sl->ref_count[1] = sl->list_count = 0;
|
||||
} else if (err == SLICE_SINGLETHREAD) {
|
||||
if (context_count > 0) {
|
||||
ret = ff_h264_execute_decode_slices(h, context_count);
|
||||
if (context_count > 1) {
|
||||
ret = ff_h264_execute_decode_slices(h, context_count - 1);
|
||||
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
|
||||
goto end;
|
||||
context_count = 0;
|
||||
@@ -1676,47 +1674,6 @@ again:
|
||||
|
||||
ret = 0;
|
||||
end:
|
||||
|
||||
#if CONFIG_ERROR_RESILIENCE
|
||||
sl = h->slice_ctx;
|
||||
/*
|
||||
* FIXME: Error handling code does not seem to support interlaced
|
||||
* when slices span multiple rows
|
||||
* The ff_er_add_slice calls don't work right for bottom
|
||||
* fields; they cause massive erroneous error concealing
|
||||
* Error marking covers both fields (top and bottom).
|
||||
* This causes a mismatched s->error_count
|
||||
* and a bad error table. Further, the error count goes to
|
||||
* INT_MAX when called for bottom field, because mb_y is
|
||||
* past end by one (callers fault) and resync_mb_y != 0
|
||||
* causes problems for the first MB line, too.
|
||||
*/
|
||||
if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) {
|
||||
int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0];
|
||||
|
||||
ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr);
|
||||
|
||||
if (use_last_pic) {
|
||||
ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec);
|
||||
sl->ref_list[0][0].parent = &h->last_pic_for_ec;
|
||||
memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data));
|
||||
memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize));
|
||||
sl->ref_list[0][0].reference = h->last_pic_for_ec.reference;
|
||||
} else if (sl->ref_count[0]) {
|
||||
ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent);
|
||||
} else
|
||||
ff_h264_set_erpic(&sl->er.last_pic, NULL);
|
||||
|
||||
if (sl->ref_count[1])
|
||||
ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent);
|
||||
|
||||
sl->er.ref_count = sl->ref_count[0];
|
||||
|
||||
ff_er_frame_end(&sl->er);
|
||||
if (use_last_pic)
|
||||
memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0]));
|
||||
}
|
||||
#endif /* CONFIG_ERROR_RESILIENCE */
|
||||
/* clean up */
|
||||
if (h->cur_pic_ptr && !h->droppable) {
|
||||
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
|
||||
@@ -1779,7 +1736,7 @@ static int is_extra(const uint8_t *buf, int buf_size)
|
||||
const uint8_t *p= buf+6;
|
||||
while(cnt--){
|
||||
int nalsize= AV_RB16(p) + 2;
|
||||
if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 7)
|
||||
if(nalsize > buf_size - (p-buf) || p[2]!=0x67)
|
||||
return 0;
|
||||
p += nalsize;
|
||||
}
|
||||
@@ -1788,7 +1745,7 @@ static int is_extra(const uint8_t *buf, int buf_size)
|
||||
return 0;
|
||||
while(cnt--){
|
||||
int nalsize= AV_RB16(p) + 2;
|
||||
if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 8)
|
||||
if(nalsize > buf_size - (p-buf) || p[2]!=0x68)
|
||||
return 0;
|
||||
p += nalsize;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user