Compare commits
266 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1fd7fb9036 | ||
![]() |
9cc1d21e76 | ||
![]() |
0b0293ceaf | ||
![]() |
1b3332659a | ||
![]() |
07c9df792c | ||
![]() |
3b4e9dddcf | ||
![]() |
2ba1af5791 | ||
![]() |
51e880fed9 | ||
![]() |
86f4ac9365 | ||
![]() |
fe457ce4d1 | ||
![]() |
4506958289 | ||
![]() |
6300790144 | ||
![]() |
20a4cf0d09 | ||
![]() |
54b76eb595 | ||
![]() |
0787163cf3 | ||
![]() |
134ff88c6a | ||
![]() |
e2e145db89 | ||
![]() |
efdd30df06 | ||
![]() |
54e3aff10e | ||
![]() |
d9ec3070d1 | ||
![]() |
6ac156864c | ||
![]() |
0775653b4c | ||
![]() |
33c8bb2c6a | ||
![]() |
883795fb0f | ||
![]() |
849f55368c | ||
![]() |
b86c2640f6 | ||
![]() |
9b9411c1cf | ||
![]() |
54825047ab | ||
![]() |
a7c18b628f | ||
![]() |
81754d8f8b | ||
![]() |
36e6842aa6 | ||
![]() |
47e4a1ac6d | ||
![]() |
a058cbcfdf | ||
![]() |
4895211635 | ||
![]() |
58dc526ebf | ||
![]() |
eac49477aa | ||
![]() |
69a930b988 | ||
![]() |
55788572ea | ||
![]() |
aa7a19b417 | ||
![]() |
577f1feb3f | ||
![]() |
4afe2684d8 | ||
![]() |
5d1d143a4e | ||
![]() |
820f41e1a1 | ||
![]() |
14d6ea0c45 | ||
![]() |
0fb2b61614 | ||
![]() |
0d277be45a | ||
![]() |
3b332ef33c | ||
![]() |
787e4d12da | ||
![]() |
95c298b125 | ||
![]() |
fd72ff6f31 | ||
![]() |
82db2f2ac8 | ||
![]() |
f36b3c5df9 | ||
![]() |
117dcc2097 | ||
![]() |
c4e18917d4 | ||
![]() |
03fbc282ff | ||
![]() |
f30a89e15f | ||
![]() |
3ea49fc508 | ||
![]() |
9bafd6a8f6 | ||
![]() |
396195c505 | ||
![]() |
e2324b5b37 | ||
![]() |
bb97f243ba | ||
![]() |
b6dc16bd95 | ||
![]() |
a9c77e5c22 | ||
![]() |
de882ec2b1 | ||
![]() |
bd62554ad2 | ||
![]() |
cd51f41791 | ||
![]() |
da811dfc93 | ||
![]() |
dce726f091 | ||
![]() |
ea5b4c682c | ||
![]() |
65d426bddd | ||
![]() |
64fdce7802 | ||
![]() |
195e8ecacc | ||
![]() |
a4ffcf024e | ||
![]() |
da52c0ebc6 | ||
![]() |
8815ddc29f | ||
![]() |
5ceae49caf | ||
![]() |
864c0c50eb | ||
![]() |
89dbef7329 | ||
![]() |
93df243a59 | ||
![]() |
db61d34e83 | ||
![]() |
309609ce4d | ||
![]() |
6607057d0e | ||
![]() |
575dc3a1b2 | ||
![]() |
1cc6fef067 | ||
![]() |
60ccc1a748 | ||
![]() |
b31a3c6f26 | ||
![]() |
ce99ef48ea | ||
![]() |
dd2394754d | ||
![]() |
883f3e18dd | ||
![]() |
06336ce760 | ||
![]() |
6f580e8735 | ||
![]() |
5c2d8bbffa | ||
![]() |
4b8f3c5bf3 | ||
![]() |
18dba3d80d | ||
![]() |
2ba17ac96c | ||
![]() |
12e064d6c2 | ||
![]() |
f2595a6c38 | ||
![]() |
a654f483cd | ||
![]() |
991a203479 | ||
![]() |
8524009161 | ||
![]() |
47f345de1d | ||
![]() |
af0a95ee03 | ||
![]() |
2abc6e930b | ||
![]() |
3bb48296ef | ||
![]() |
a3fdc0b35b | ||
![]() |
cf8b91a28e | ||
![]() |
cfda2a677c | ||
![]() |
11dfd1fa20 | ||
![]() |
f7e9fcda2d | ||
![]() |
2719ba9ee3 | ||
![]() |
d48e0aed3c | ||
![]() |
89b52d25b4 | ||
![]() |
9984d492dc | ||
![]() |
56b84b023d | ||
![]() |
0e216ed407 | ||
![]() |
f783259fdb | ||
![]() |
b6691fba77 | ||
![]() |
15fd62110f | ||
![]() |
86b532898d | ||
![]() |
ca78ee73db | ||
![]() |
517ce1d09b | ||
![]() |
46a17d886b | ||
![]() |
944570906b | ||
![]() |
057ee35924 | ||
![]() |
e386241d54 | ||
![]() |
222236317b | ||
![]() |
633a2a082f | ||
![]() |
e5f5df37c8 | ||
![]() |
cc9c74ea87 | ||
![]() |
12700b0219 | ||
![]() |
3e0802e42b | ||
![]() |
56e11cbe32 | ||
![]() |
2be7d565bb | ||
![]() |
c7b64a904a | ||
![]() |
9798dc8061 | ||
![]() |
a5cc8775cf | ||
![]() |
f9ca1fecb0 | ||
![]() |
cd57d608a4 | ||
![]() |
043f326060 | ||
![]() |
9a641b909c | ||
![]() |
5405ba7b63 | ||
![]() |
70f6d553d9 | ||
![]() |
25fc3deed8 | ||
![]() |
a8a6cdfcd7 | ||
![]() |
39518589e7 | ||
![]() |
857e391697 | ||
![]() |
04aa2ffbcf | ||
![]() |
63523485f4 | ||
![]() |
35bc67503e | ||
![]() |
1f636a697f | ||
![]() |
24d725f455 | ||
![]() |
66fcf1fa40 | ||
![]() |
c7b7e0790c | ||
![]() |
3f3e5f8f60 | ||
![]() |
8e95ddbe82 | ||
![]() |
8cba067fe5 | ||
![]() |
73c6520c09 | ||
![]() |
ca47574e16 | ||
![]() |
045670a6f7 | ||
![]() |
30a0622a5d | ||
![]() |
e4d921dc71 | ||
![]() |
2185103bcd | ||
![]() |
bf7ee2524b | ||
![]() |
5a1efc7b85 | ||
![]() |
71af22097d | ||
![]() |
f3d34cff76 | ||
![]() |
81b38caf21 | ||
![]() |
20071ff1a4 | ||
![]() |
3b7db9c4f5 | ||
![]() |
0ddcee172e | ||
![]() |
13ecdb06f8 | ||
![]() |
ca8c62d187 | ||
![]() |
e443165c32 | ||
![]() |
0b41eeac45 | ||
![]() |
de31f85707 | ||
![]() |
d61454e7c1 | ||
![]() |
b02e4faa3e | ||
![]() |
09256527be | ||
![]() |
84d26ab6eb | ||
![]() |
1d99adc953 | ||
![]() |
67991f3a3e | ||
![]() |
32e8922faf | ||
![]() |
32dbd1f342 | ||
![]() |
eefc3ca7be | ||
![]() |
a16558e122 | ||
![]() |
506368f563 | ||
![]() |
c0c24bc9b3 | ||
![]() |
b89f279cd6 | ||
![]() |
7f90eef87a | ||
![]() |
71f0a3c4ad | ||
![]() |
d9bef14e41 | ||
![]() |
4b4ed88e89 | ||
![]() |
f6476944e1 | ||
![]() |
03d30d4c2c | ||
![]() |
853a27e345 | ||
![]() |
f7c0f8355e | ||
![]() |
6f5c505109 | ||
![]() |
b29f9897e3 | ||
![]() |
1d987a34d8 | ||
![]() |
6099d1ca0e | ||
![]() |
a9b9751bc8 | ||
![]() |
da5e52010c | ||
![]() |
e1fd837888 | ||
![]() |
1d10997488 | ||
![]() |
76a5cf1f80 | ||
![]() |
16c3d6d392 | ||
![]() |
9d79848f84 | ||
![]() |
b8d34604ff | ||
![]() |
7a02b9cb2d | ||
![]() |
ff6d440d10 | ||
![]() |
a88a57cd24 | ||
![]() |
0cda7baa8b | ||
![]() |
31baa6f199 | ||
![]() |
3b364ac18a | ||
![]() |
63660277fd | ||
![]() |
6101187c55 | ||
![]() |
91ff803a74 | ||
![]() |
4f4f78ea48 | ||
![]() |
ff24824a72 | ||
![]() |
570cefb02b | ||
![]() |
ce0972ecdd | ||
![]() |
09c848855a | ||
![]() |
e1ce4f805f | ||
![]() |
bb5c0ac922 | ||
![]() |
d389438296 | ||
![]() |
3b57d7769a | ||
![]() |
b7f2719951 | ||
![]() |
dc4e34a2f0 | ||
![]() |
d694ab846c | ||
![]() |
ab02548c8a | ||
![]() |
9eb442cca2 | ||
![]() |
b45ab61b24 | ||
![]() |
cc73b4f574 | ||
![]() |
8ac3b2cdb7 | ||
![]() |
ace90ee265 | ||
![]() |
703bd31647 | ||
![]() |
c16e80ee3d | ||
![]() |
66ac5b96e8 | ||
![]() |
547cad8c81 | ||
![]() |
55b1a1e9c1 | ||
![]() |
f851477889 | ||
![]() |
4f2d4b98fc | ||
![]() |
7d8ebb8774 | ||
![]() |
07b0ccf511 | ||
![]() |
9d3e69ae30 | ||
![]() |
480633c6c2 | ||
![]() |
b5d4f49e3c | ||
![]() |
4cde8bae49 | ||
![]() |
5b740d1eaa | ||
![]() |
152e09fde7 | ||
![]() |
110841c3ab | ||
![]() |
5694831e06 | ||
![]() |
1f52f82a55 | ||
![]() |
e62f08ca8d | ||
![]() |
ee099059e7 | ||
![]() |
e2a89f7f0f | ||
![]() |
7c46855074 | ||
![]() |
c2d6cc2971 | ||
![]() |
8c91414803 | ||
![]() |
0263750a0d | ||
![]() |
63795fe5b9 | ||
![]() |
d2bad216f7 | ||
![]() |
d04fb11868 | ||
![]() |
e8f2823f06 | ||
![]() |
7dfccac20c | ||
![]() |
04361427e6 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.pnm -diff -text
|
169
Changelog
169
Changelog
@ -2,6 +2,175 @@ Entries are sorted chronologically from oldest to youngest within each release,
|
|||||||
releases are sorted from youngest to oldest.
|
releases are sorted from youngest to oldest.
|
||||||
|
|
||||||
version <next>:
|
version <next>:
|
||||||
|
|
||||||
|
|
||||||
|
version 2.4.6:
|
||||||
|
- doc/examples: fix lib math dep for decoding_encoding
|
||||||
|
- avformat/movenc: workaround bug in "PathScale EKOPath(tm) Compiler Suite Version 4.0.12.1"
|
||||||
|
- vp9: fix parser return values in error case
|
||||||
|
- ffmpeg: Clear error message array at init.
|
||||||
|
- avcodec/dvdsubdec: fix accessing dangling pointers
|
||||||
|
- avcodec/dvdsubdec: error on bitmaps with size 0
|
||||||
|
- avformat/mov: Fix mixed declaration and statement warning
|
||||||
|
- cmdutils: Use 64bit for file size/offset related variable in cmdutils_read_file()
|
||||||
|
- avformat/utils: Clear pointer in ff_alloc_extradata() to avoid leaving a stale pointer in memory
|
||||||
|
- avformat/matroskadec: Use av_freep() to avoid leaving stale pointers in memory
|
||||||
|
- lavfi: check av_strdup() return value
|
||||||
|
- mov: Fix negative size calculation in mov_read_default().
|
||||||
|
- avformat/mov: fix integer overflow in mov_read_udta_string()
|
||||||
|
- mov: Avoid overflow with mov_metadata_raw()
|
||||||
|
- avcodec/dvdsubdec: fix out of bounds accesses
|
||||||
|
- avfilter/vf_sab: fix filtering tiny images
|
||||||
|
- avformat/flvdec: Increase string array size
|
||||||
|
- avformat/flvdec: do not inject dts=0 metadata packets which failed to be parsed into a new data stream
|
||||||
|
- avformat/cdxl: Fix integer overflow of image_size
|
||||||
|
- avformat/segment: Use av_freep() avoid leaving stale pointers in memory
|
||||||
|
- avformat/mov: Fix memleaks for duplicate STCO/CO64/STSC atoms
|
||||||
|
- mov: avoid a memleak when multiple stss boxes are presen
|
||||||
|
|
||||||
|
version 2.4.5:
|
||||||
|
- lavu/frame: fix malloc error path in av_frame_copy_props()
|
||||||
|
- avformat/utils: Do not update programs streams from program-less streams in update_wrap_reference()
|
||||||
|
- avformat/aviobuf: Check that avio_seek() target is non negative
|
||||||
|
- swresample/soxr_resample: fix error handling
|
||||||
|
- avformat/flvdec: fix potential use of uninitialized variables
|
||||||
|
- avformat/matroskadec: fix handling of recursive SeekHead elements
|
||||||
|
- doc/examples/transcoding: check encoder before using it
|
||||||
|
- swscale/x86/rgb2rgb_template: fix crash with tiny size and nv12 output
|
||||||
|
- avformat/rmdec: Check codec_data_size
|
||||||
|
- avformat/aviobuf: Fix infinite loop in ff_get_line()
|
||||||
|
- vc1: Do not assume seek happens after decoding
|
||||||
|
- mmvideo: check frame dimensions
|
||||||
|
- jvdec: check frame dimensions
|
||||||
|
- avcodec/indeo3: ensure offsets are non negative
|
||||||
|
- avcodec/h264: Check *log2_weight_denom
|
||||||
|
- avcodec/hevc_ps: Check diff_cu_qp_delta_depth
|
||||||
|
- avcodec/h264: Clear delayed_pic on deallocation
|
||||||
|
- avcodec/hevc: clear filter_slice_edges() on allocation
|
||||||
|
- avcodec/dcadec: Check that the added xch channel isnt already there
|
||||||
|
- avcodec/indeo3: use signed variables to avoid underflow
|
||||||
|
- swscale: increase yuv2rgb table headroom
|
||||||
|
- avformat/mov: fix integer overflow of size
|
||||||
|
- avformat/mov: check atom nesting depth
|
||||||
|
- avcodec/utvideodec: Fix handling of slice_height=0
|
||||||
|
- avcodec/vmdvideo: Check len before using it in method 3
|
||||||
|
- avformat/flvdec: Use av_freep() avoid leaving stale pointers in memory
|
||||||
|
- avformat/hdsenc: Use av_freep() avoid leaving stale pointers in memory
|
||||||
|
- configure: create the tests directory like the doc directory
|
||||||
|
- v4l2: Make use of the VIDIOC_ENUM_FRAMESIZES ioctl on OpenBSD
|
||||||
|
- avcodec/motion_est: use 2x8x8 for interlaced qpel
|
||||||
|
- Treat all '*.pnm' files as non-text file
|
||||||
|
|
||||||
|
version 2.4.4:
|
||||||
|
- avformat: replace some odd 30-60 rates by higher less odd ones in get_std_framerate()
|
||||||
|
- swscale: fix yuv2yuvX_8 assembly on x86
|
||||||
|
- avcodec/hevc_ps: Check num_long_term_ref_pics_sps
|
||||||
|
- avcodec/mjpegdec: Fix integer overflow in shift
|
||||||
|
- avcodec/hevc_ps: Check return code from pps_range_extensions()
|
||||||
|
- avcodec/rawdec: Check the return code of avpicture_get_size()
|
||||||
|
- avcodec/pngdec: Check IHDR/IDAT order
|
||||||
|
- avcodec/flacdec: Call ff_flacdsp_init() unconditionally
|
||||||
|
- avcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata()
|
||||||
|
- avcodec/mjpegdec: Fix context fields becoming inconsistent
|
||||||
|
- avcodec/mjpegdec: Check for pixfmtid 0x42111100 || 0x24111100 with more than 8 bits
|
||||||
|
- swscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()
|
||||||
|
- doc/APIchanges: Fix some wrong versions
|
||||||
|
- avformat/hlsenc: Free context after hls_append_segment
|
||||||
|
- avcodec/mpeg4video_parser: fix spurious extradata parse warnings
|
||||||
|
- lavu/opt: fix av_opt_get function
|
||||||
|
- avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization
|
||||||
|
- avcodec/utvideodec: fix assumtation that slice_height >= 1
|
||||||
|
- avcodec/options_table fix min of audio channels and sample rate
|
||||||
|
- libavutil/thread.h: Support OS/2 threads
|
||||||
|
- fix Makefile objects for pulseaudio support
|
||||||
|
- opusdec: make sure all substreams have the same number of coded samples
|
||||||
|
- lavu: add wrappers for the pthreads mutex API
|
||||||
|
- avformat/avidec: fix handling dv in avi
|
||||||
|
- avfilter/vf_lut: gammaval709()
|
||||||
|
- cinedec: report white balance gain coefficients using metadata
|
||||||
|
- swscale/utils: support bayer input + scaling, and bayer input + any supported output
|
||||||
|
- swscale: support internal scaler cascades
|
||||||
|
- avformat/dtsdec: dts_probe: check reserved bit, check lfe, check sr_code similarity
|
||||||
|
- avformat/segment: export inner muxer timebase
|
||||||
|
- Remove fminf() emulation, fix build issues
|
||||||
|
- avcodec/mpegaudio_parser: fix off by 1 error in bitrate calculation
|
||||||
|
- Use -fno-optimize-sibling-calls on parisc also for gcc 4.9.
|
||||||
|
- ffmpeg_opt: store canvas size in decoder context
|
||||||
|
- avcodec/mpeg12dec: do not trust AVCodecContext input dimensions
|
||||||
|
|
||||||
|
version 2.4.3:
|
||||||
|
- avcodec/svq1dec: zero terminate embedded message before printing
|
||||||
|
- avcodec/cook: check that the subpacket sizes fit in block_align
|
||||||
|
- avcodec/g2meet: check tile dimensions to avoid integer overflow
|
||||||
|
- avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
|
||||||
|
- avcodec/dnxhddec: treat pix_fmt like width/height
|
||||||
|
- avcodec/dxa: check dimensions
|
||||||
|
- avcodec/dirac_arith: fix integer overflow
|
||||||
|
- avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
|
||||||
|
- avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
|
||||||
|
- avcodec/sgidec: fix count check
|
||||||
|
- avcodec/sgidec: fix linesize for 16bit
|
||||||
|
- avcodec/hevc_ps: Check default display window bitstream and skip if invalid
|
||||||
|
- avcodec/tiffenc: properly compute packet size
|
||||||
|
- lavd: export all symbols with av_ prefix
|
||||||
|
- avformat/mxfdec: Fix termination of mxf_data_essence_container_uls
|
||||||
|
- postproc: fix qp count
|
||||||
|
- postproc/postprocess: fix quant store for fq mode
|
||||||
|
- vf_drawtext: add missing clear of pointers after av_expr_free()
|
||||||
|
- utvideoenc: properly set slice height/last line
|
||||||
|
- swresample: fix sample drop loop end condition
|
||||||
|
- resample: Avoid off-by-1 errors in PTS calcs.
|
||||||
|
- imc: fix order of operations in coefficients read
|
||||||
|
- hevc_mvs: make sure to always initialize the temporal MV fully
|
||||||
|
- hevc_mvs: initialize the temporal MV in case of missing reference
|
||||||
|
|
||||||
|
version 2.4.2:
|
||||||
|
- avcodec/on2avc: Check number of channels
|
||||||
|
- avcodec/hevc: fix chroma transform_add size
|
||||||
|
- avcodec/h264: Check mode before considering mixed mode intra prediction
|
||||||
|
- avformat/mpegts: use a padded buffer in read_sl_header()
|
||||||
|
- avformat/mpegts: Check desc_len / get8() return code
|
||||||
|
- avcodec/vorbisdec: Fix off by 1 error in ptns_to_read
|
||||||
|
- sdp: add support for H.261
|
||||||
|
- avcodec/svq3: Do not memcpy AVFrame
|
||||||
|
- avcodec/smc: fix off by 1 error
|
||||||
|
- avcodec/qpeg: fix off by 1 error in MV bounds check
|
||||||
|
- avcodec/gifdec: factorize interleave end handling out
|
||||||
|
- avcodec/cinepak: fix integer underflow
|
||||||
|
- avcodec/pngdec: Check bits per pixel before setting monoblack pixel format
|
||||||
|
- avcodec/pngdec: Calculate MPNG bytewidth more defensively
|
||||||
|
- avcodec/tiff: more completely check bpp/bppcount
|
||||||
|
- avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks
|
||||||
|
- avcodec/h263dec: Fix decoding messenger.h263
|
||||||
|
- avcodec/utils: Add case for jv to avcodec_align_dimensions2()
|
||||||
|
- avcodec/mjpegdec: check bits per pixel for changes similar to dimensions
|
||||||
|
- avcodec/jpeglsdec: Check run value more completely in ls_decode_line()
|
||||||
|
- avformat/hlsenc: export inner muxer timebase
|
||||||
|
- configure: add noexecstack to linker options if supported.
|
||||||
|
- avcodec/ac3enc_template: fix out of array read
|
||||||
|
- avutil/x86/cpu: fix cpuid sub-leaf selection
|
||||||
|
- avformat/img2dec: enable generic seeking for image pipes
|
||||||
|
- avformat/img2dec: initialize pkt->pos for image pipes
|
||||||
|
- avformat/img2dec: pass error code and signal EOF
|
||||||
|
- avformat/img2dec: fix error code at EOF for pipes
|
||||||
|
- libavutil/opt: fix av_opt_set_channel_layout() to access correct memory address
|
||||||
|
- tests/fate-run.sh: Cat .err file in case of error with V>0
|
||||||
|
- avformat/riffenc: Filter out "BottomUp" in ff_put_bmp_header()
|
||||||
|
- avcodec/webp: fix default palette color 0xff000000 -> 0x00000000
|
||||||
|
- avcodec/asvenc: fix AAN scaling
|
||||||
|
- Fix compile error on arm4/arm5 platform
|
||||||
|
|
||||||
|
|
||||||
|
version 2.4.1:
|
||||||
|
- swscale: Allow chroma samples to be above and to the left of luma samples
|
||||||
|
- avcodec/libilbc: support for latest git of libilbc
|
||||||
|
- avcodec/webp: treat out-of-bound palette index as translucent black
|
||||||
|
- vf_deshake: rename Transform.vector to Transform.vec to avoid compiler confusion
|
||||||
|
- apetag: Fix APE tag size check
|
||||||
|
- tools/crypto_bench: fix build when AV_READ_TIME is unavailable
|
||||||
|
|
||||||
|
|
||||||
|
version 2.4:
|
||||||
- Icecast protocol
|
- Icecast protocol
|
||||||
- ported lenscorrection filter from frei0r filter
|
- ported lenscorrection filter from frei0r filter
|
||||||
- large optimizations in dctdnoiz to make it usable
|
- large optimizations in dctdnoiz to make it usable
|
||||||
|
@ -534,7 +534,7 @@ x86 Michael Niedermayer
|
|||||||
Releases
|
Releases
|
||||||
========
|
========
|
||||||
|
|
||||||
2.3 Michael Niedermayer
|
2.4 Michael Niedermayer
|
||||||
2.2 Michael Niedermayer
|
2.2 Michael Niedermayer
|
||||||
1.2 Michael Niedermayer
|
1.2 Michael Niedermayer
|
||||||
|
|
||||||
|
2
Makefile
2
Makefile
@ -111,7 +111,7 @@ endef
|
|||||||
|
|
||||||
$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
|
$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
|
||||||
|
|
||||||
ffprobe.o cmdutils.o : libavutil/ffversion.h
|
ffprobe.o cmdutils.o libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
|
||||||
|
|
||||||
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
|
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
|
||||||
$(CP) $< $@
|
$(CP) $< $@
|
||||||
|
@ -53,6 +53,8 @@
|
|||||||
• API for live metadata updates through event flags.
|
• API for live metadata updates through event flags.
|
||||||
• UTF-16 support in text subtitles formats.
|
• UTF-16 support in text subtitles formats.
|
||||||
• The ASS muxer now reorders the Dialogue events properly.
|
• The ASS muxer now reorders the Dialogue events properly.
|
||||||
|
• support for H.261 RTP payload format (RFC 4587)
|
||||||
|
• HEVC/H.265 RTP payload format (draft v6) depacketizer
|
||||||
|
|
||||||
┌────────────────────────────┐
|
┌────────────────────────────┐
|
||||||
│ libavfilter │
|
│ libavfilter │
|
||||||
|
@ -1857,7 +1857,7 @@ int read_yesno(void)
|
|||||||
|
|
||||||
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
||||||
{
|
{
|
||||||
int ret;
|
int64_t ret;
|
||||||
FILE *f = av_fopen_utf8(filename, "rb");
|
FILE *f = av_fopen_utf8(filename, "rb");
|
||||||
|
|
||||||
if (!f) {
|
if (!f) {
|
||||||
|
12
configure
vendored
12
configure
vendored
@ -1668,7 +1668,6 @@ MATH_FUNCS="
|
|||||||
exp2
|
exp2
|
||||||
exp2f
|
exp2f
|
||||||
expf
|
expf
|
||||||
fminf
|
|
||||||
isinf
|
isinf
|
||||||
isnan
|
isnan
|
||||||
ldexpf
|
ldexpf
|
||||||
@ -3934,6 +3933,9 @@ case "$arch" in
|
|||||||
;;
|
;;
|
||||||
x86)
|
x86)
|
||||||
check_64bit x86_32 x86_64 'sizeof(void *) > 4'
|
check_64bit x86_32 x86_64 'sizeof(void *) > 4'
|
||||||
|
# Treat x32 as x64 for now. Note it also needs spic=$shared
|
||||||
|
test "$subarch" = "x86_32" && check_cpp_condition stddef.h 'defined(__x86_64__)' &&
|
||||||
|
subarch=x86_64
|
||||||
if test "$subarch" = "x86_64"; then
|
if test "$subarch" = "x86_64"; then
|
||||||
spic=$shared
|
spic=$shared
|
||||||
fi
|
fi
|
||||||
@ -4500,7 +4502,7 @@ elif enabled parisc; then
|
|||||||
|
|
||||||
if enabled gcc; then
|
if enabled gcc; then
|
||||||
case $($cc -dumpversion) in
|
case $($cc -dumpversion) in
|
||||||
4.[3-8].*) check_cflags -fno-optimize-sibling-calls ;;
|
4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -4608,6 +4610,7 @@ fi
|
|||||||
check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
|
check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
|
||||||
|
|
||||||
check_ldflags -Wl,--as-needed
|
check_ldflags -Wl,--as-needed
|
||||||
|
check_ldflags -Wl,-z,noexecstack
|
||||||
|
|
||||||
if check_func dlopen; then
|
if check_func dlopen; then
|
||||||
ldl=
|
ldl=
|
||||||
@ -4781,7 +4784,6 @@ disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersi
|
|||||||
atan2f_args=2
|
atan2f_args=2
|
||||||
ldexpf_args=2
|
ldexpf_args=2
|
||||||
powf_args=2
|
powf_args=2
|
||||||
fminf_args=2
|
|
||||||
|
|
||||||
for func in $MATH_FUNCS; do
|
for func in $MATH_FUNCS; do
|
||||||
eval check_mathfunc $func \${${func}_args:-1}
|
eval check_mathfunc $func \${${func}_args:-1}
|
||||||
@ -4942,6 +4944,7 @@ check_header linux/videodev2.h
|
|||||||
check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
|
check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
|
||||||
|
|
||||||
check_header sys/videoio.h
|
check_header sys/videoio.h
|
||||||
|
check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
|
||||||
|
|
||||||
check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
|
check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
|
||||||
# check that WM_CAP_DRIVER_CONNECT is defined to the proper value
|
# check that WM_CAP_DRIVER_CONNECT is defined to the proper value
|
||||||
@ -5597,7 +5600,7 @@ cat > $TMPH <<EOF
|
|||||||
#define FFMPEG_CONFIG_H
|
#define FFMPEG_CONFIG_H
|
||||||
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
|
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
|
||||||
#define FFMPEG_LICENSE "$(c_escape $license)"
|
#define FFMPEG_LICENSE "$(c_escape $license)"
|
||||||
#define CONFIG_THIS_YEAR 2014
|
#define CONFIG_THIS_YEAR 2015
|
||||||
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
|
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
|
||||||
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
|
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
|
||||||
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
|
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
|
||||||
@ -5625,6 +5628,7 @@ enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
|
|||||||
|
|
||||||
|
|
||||||
mkdir -p doc
|
mkdir -p doc
|
||||||
|
mkdir -p tests
|
||||||
echo "@c auto-generated by configure" > doc/config.texi
|
echo "@c auto-generated by configure" > doc/config.texi
|
||||||
|
|
||||||
print_config ARCH_ "$config_files" $ARCH_LIST
|
print_config ARCH_ "$config_files" $ARCH_LIST
|
||||||
|
@ -214,10 +214,10 @@ API changes, most recent first:
|
|||||||
2014-05-11 - 14aef38 / 66e6c8a - lavu 52.83.100 / 53.14.0 - pixfmt.h
|
2014-05-11 - 14aef38 / 66e6c8a - lavu 52.83.100 / 53.14.0 - pixfmt.h
|
||||||
Add AV_PIX_FMT_VDA for new-style VDA acceleration.
|
Add AV_PIX_FMT_VDA for new-style VDA acceleration.
|
||||||
|
|
||||||
2014-05-xx - xxxxxxx - lavu 52.82.0 - fifo.h
|
2014-05-xx - xxxxxxx - lavu 52.82.100 - fifo.h
|
||||||
Add av_fifo_freep() function.
|
Add av_fifo_freep() function.
|
||||||
|
|
||||||
2014-05-02 - ba52fb11 - lavu 52.81.0 - opt.h
|
2014-05-02 - ba52fb11 - lavu 52.81.100 - opt.h
|
||||||
Add av_opt_set_dict2() function.
|
Add av_opt_set_dict2() function.
|
||||||
|
|
||||||
2014-05-01 - e77b985 / a2941c8 - lavc 55.60.103 / 55.50.3 - avcodec.h
|
2014-05-01 - e77b985 / a2941c8 - lavc 55.60.103 / 55.50.3 - avcodec.h
|
||||||
|
@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER =
|
PROJECT_NUMBER = 2.4.6
|
||||||
|
|
||||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
|
# 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
|
# in the documentation. The maximum height of the logo should not exceed 55
|
||||||
|
@ -29,6 +29,7 @@ OBJS=$(addsuffix .o,$(EXAMPLES))
|
|||||||
|
|
||||||
# the following examples make explicit use of the math library
|
# the following examples make explicit use of the math library
|
||||||
avcodec: LDLIBS += -lm
|
avcodec: LDLIBS += -lm
|
||||||
|
decoding_encoding: LDLIBS += -lm
|
||||||
muxing: LDLIBS += -lm
|
muxing: LDLIBS += -lm
|
||||||
resampling_audio: LDLIBS += -lm
|
resampling_audio: LDLIBS += -lm
|
||||||
|
|
||||||
|
@ -199,8 +199,7 @@ int main(int argc, char **argv)
|
|||||||
fmt, dst_ch_layout, dst_nb_channels, dst_rate, dst_filename);
|
fmt, dst_ch_layout, dst_nb_channels, dst_rate, dst_filename);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (dst_file)
|
fclose(dst_file);
|
||||||
fclose(dst_file);
|
|
||||||
|
|
||||||
if (src_data)
|
if (src_data)
|
||||||
av_freep(&src_data[0]);
|
av_freep(&src_data[0]);
|
||||||
|
@ -132,8 +132,7 @@ int main(int argc, char **argv)
|
|||||||
av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h, dst_filename);
|
av_get_pix_fmt_name(dst_pix_fmt), dst_w, dst_h, dst_filename);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (dst_file)
|
fclose(dst_file);
|
||||||
fclose(dst_file);
|
|
||||||
av_freep(&src_data[0]);
|
av_freep(&src_data[0]);
|
||||||
av_freep(&dst_data[0]);
|
av_freep(&dst_data[0]);
|
||||||
sws_freeContext(sws_ctx);
|
sws_freeContext(sws_ctx);
|
||||||
|
@ -116,6 +116,10 @@ static int open_output_file(const char *filename)
|
|||||||
|| dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
|| dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||||
/* in this example, we choose transcoding to same codec */
|
/* in this example, we choose transcoding to same codec */
|
||||||
encoder = avcodec_find_encoder(dec_ctx->codec_id);
|
encoder = avcodec_find_encoder(dec_ctx->codec_id);
|
||||||
|
if (!encoder) {
|
||||||
|
av_log(NULL, AV_LOG_FATAL, "Neccessary encoder not found\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
/* In this example, we transcode to same properties (picture size,
|
/* In this example, we transcode to same properties (picture size,
|
||||||
* sample rate etc.). These properties can be changed for output
|
* sample rate etc.). These properties can be changed for output
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
# FFmpeg is distributed in the hope that it will be useful,
|
# FFmpeg is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
# Lesser General Public License for more details.
|
# General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Lesser General Public
|
# You should have received a copy of the GNU General Public
|
||||||
# License along with FFmpeg; if not, write to the Free Software
|
# License along with FFmpeg; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
8
ffmpeg.c
8
ffmpeg.c
@ -978,10 +978,8 @@ static void do_video_out(AVFormatContext *s,
|
|||||||
/* raw pictures are written as AVPicture structure to
|
/* raw pictures are written as AVPicture structure to
|
||||||
avoid any copies. We support temporarily the older
|
avoid any copies. We support temporarily the older
|
||||||
method. */
|
method. */
|
||||||
mux_enc->coded_frame->interlaced_frame = in_picture->interlaced_frame;
|
if (in_picture->interlaced_frame)
|
||||||
mux_enc->coded_frame->top_field_first = in_picture->top_field_first;
|
mux_enc->field_order = in_picture->top_field_first ? AV_FIELD_TB:AV_FIELD_BT;
|
||||||
if (mux_enc->coded_frame->interlaced_frame)
|
|
||||||
mux_enc->field_order = mux_enc->coded_frame->top_field_first ? AV_FIELD_TB:AV_FIELD_BT;
|
|
||||||
else
|
else
|
||||||
mux_enc->field_order = AV_FIELD_PROGRESSIVE;
|
mux_enc->field_order = AV_FIELD_PROGRESSIVE;
|
||||||
pkt.data = (uint8_t *)in_picture;
|
pkt.data = (uint8_t *)in_picture;
|
||||||
@ -2463,7 +2461,7 @@ static int transcode_init(void)
|
|||||||
AVFormatContext *oc;
|
AVFormatContext *oc;
|
||||||
OutputStream *ost;
|
OutputStream *ost;
|
||||||
InputStream *ist;
|
InputStream *ist;
|
||||||
char error[1024];
|
char error[1024] = {0};
|
||||||
int want_sdp = 1;
|
int want_sdp = 1;
|
||||||
|
|
||||||
for (i = 0; i < nb_filtergraphs; i++) {
|
for (i = 0; i < nb_filtergraphs; i++) {
|
||||||
|
@ -702,7 +702,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
|
|||||||
MATCH_PER_STREAM_OPT(fix_sub_duration, i, ist->fix_sub_duration, ic, st);
|
MATCH_PER_STREAM_OPT(fix_sub_duration, i, ist->fix_sub_duration, ic, st);
|
||||||
MATCH_PER_STREAM_OPT(canvas_sizes, str, canvas_size, ic, st);
|
MATCH_PER_STREAM_OPT(canvas_sizes, str, canvas_size, ic, st);
|
||||||
if (canvas_size &&
|
if (canvas_size &&
|
||||||
av_parse_video_size(&dec->width, &dec->height, canvas_size) < 0) {
|
av_parse_video_size(&ist->dec_ctx->width, &ist->dec_ctx->height, canvas_size) < 0) {
|
||||||
av_log(NULL, AV_LOG_FATAL, "Invalid canvas size: %s.\n", canvas_size);
|
av_log(NULL, AV_LOG_FATAL, "Invalid canvas size: %s.\n", canvas_size);
|
||||||
exit_program(1);
|
exit_program(1);
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
|
|||||||
energy_cpl = energy[blk][CPL_CH][bnd];
|
energy_cpl = energy[blk][CPL_CH][bnd];
|
||||||
energy_ch = energy[blk][ch][bnd];
|
energy_ch = energy[blk][ch][bnd];
|
||||||
blk1 = blk+1;
|
blk1 = blk+1;
|
||||||
while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
|
while (blk1 < s->num_blocks && !s->blocks[blk1].new_cpl_coords[ch]) {
|
||||||
if (s->blocks[blk1].cpl_in_use) {
|
if (s->blocks[blk1].cpl_in_use) {
|
||||||
energy_cpl += energy[blk1][CPL_CH][bnd];
|
energy_cpl += energy[blk1][CPL_CH][bnd];
|
||||||
energy_ch += energy[blk1][ch][bnd];
|
energy_ch += energy[blk1][ch][bnd];
|
||||||
|
@ -107,8 +107,10 @@ av_cold void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth,
|
|||||||
{
|
{
|
||||||
int cpu_flags = av_get_cpu_flags();
|
int cpu_flags = av_get_cpu_flags();
|
||||||
|
|
||||||
|
#if HAVE_ARMV6
|
||||||
if (have_setend(cpu_flags))
|
if (have_setend(cpu_flags))
|
||||||
c->startcode_find_candidate = ff_startcode_find_candidate_armv6;
|
c->startcode_find_candidate = ff_startcode_find_candidate_armv6;
|
||||||
|
#endif
|
||||||
if (have_neon(cpu_flags))
|
if (have_neon(cpu_flags))
|
||||||
h264dsp_init_neon(c, bit_depth, chroma_format_idc);
|
h264dsp_init_neon(c, bit_depth, chroma_format_idc);
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,10 @@ av_cold void ff_vc1dsp_init_arm(VC1DSPContext *dsp)
|
|||||||
{
|
{
|
||||||
int cpu_flags = av_get_cpu_flags();
|
int cpu_flags = av_get_cpu_flags();
|
||||||
|
|
||||||
|
#if HAVE_ARMV6
|
||||||
if (have_setend(cpu_flags))
|
if (have_setend(cpu_flags))
|
||||||
dsp->startcode_find_candidate = ff_startcode_find_candidate_armv6;
|
dsp->startcode_find_candidate = ff_startcode_find_candidate_armv6;
|
||||||
|
#endif
|
||||||
if (have_neon(cpu_flags))
|
if (have_neon(cpu_flags))
|
||||||
ff_vc1dsp_init_neon(dsp);
|
ff_vc1dsp_init_neon(dsp);
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,10 @@
|
|||||||
#include "libavutil/attributes.h"
|
#include "libavutil/attributes.h"
|
||||||
#include "libavutil/mem.h"
|
#include "libavutil/mem.h"
|
||||||
|
|
||||||
|
#include "aandcttab.h"
|
||||||
#include "asv.h"
|
#include "asv.h"
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
|
#include "dct.h"
|
||||||
#include "fdctdsp.h"
|
#include "fdctdsp.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "mathops.h"
|
#include "mathops.h"
|
||||||
@ -331,8 +333,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
|||||||
((uint32_t *) avctx->extradata)[1] = av_le2ne32(AV_RL32("ASUS"));
|
((uint32_t *) avctx->extradata)[1] = av_le2ne32(AV_RL32("ASUS"));
|
||||||
|
|
||||||
for (i = 0; i < 64; i++) {
|
for (i = 0; i < 64; i++) {
|
||||||
int q = 32 * scale * ff_mpeg1_default_intra_matrix[i];
|
if (a->fdsp.fdct == ff_fdct_ifast) {
|
||||||
a->q_intra_matrix[i] = ((a->inv_qscale << 16) + q / 2) / q;
|
int q = 32LL * scale * ff_mpeg1_default_intra_matrix[i] * ff_aanscales[i];
|
||||||
|
a->q_intra_matrix[i] = (((int64_t)a->inv_qscale << 30) + q / 2) / q;
|
||||||
|
} else {
|
||||||
|
int q = 32 * scale * ff_mpeg1_default_intra_matrix[i];
|
||||||
|
a->q_intra_matrix[i] = ((a->inv_qscale << 16) + q / 2) / q;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -135,7 +135,7 @@ static int cinepak_decode_vectors (CinepakContext *s, cvid_strip *strip,
|
|||||||
const uint8_t *eod = (data + size);
|
const uint8_t *eod = (data + size);
|
||||||
uint32_t flag, mask;
|
uint32_t flag, mask;
|
||||||
uint8_t *cb0, *cb1, *cb2, *cb3;
|
uint8_t *cb0, *cb1, *cb2, *cb3;
|
||||||
unsigned int x, y;
|
int x, y;
|
||||||
char *ip0, *ip1, *ip2, *ip3;
|
char *ip0, *ip1, *ip2, *ip3;
|
||||||
|
|
||||||
flag = 0;
|
flag = 0;
|
||||||
|
@ -1215,8 +1215,8 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
q->num_subpackets++;
|
q->num_subpackets++;
|
||||||
s++;
|
s++;
|
||||||
if (s > MAX_SUBPACKETS) {
|
if (s > FFMIN(MAX_SUBPACKETS, avctx->block_align)) {
|
||||||
avpriv_request_sample(avctx, "subpackets > %d", MAX_SUBPACKETS);
|
avpriv_request_sample(avctx, "subpackets > %d", FFMIN(MAX_SUBPACKETS, avctx->block_align));
|
||||||
return AVERROR_PATCHWELCOME;
|
return AVERROR_PATCHWELCOME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2359,6 +2359,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
#else
|
#else
|
||||||
if (s->xch_present && !s->xch_disable) {
|
if (s->xch_present && !s->xch_disable) {
|
||||||
#endif
|
#endif
|
||||||
|
if (avctx->channel_layout & AV_CH_BACK_CENTER) {
|
||||||
|
avpriv_request_sample(avctx, "XCh with Back center channel");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
avctx->channel_layout |= AV_CH_BACK_CENTER;
|
avctx->channel_layout |= AV_CH_BACK_CENTER;
|
||||||
if (s->lfe) {
|
if (s->lfe) {
|
||||||
avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
|
avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
|
||||||
|
@ -171,6 +171,10 @@ static inline int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_c
|
|||||||
{
|
{
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
while (!dirac_get_arith_bit(c, follow_ctx)) {
|
while (!dirac_get_arith_bit(c, follow_ctx)) {
|
||||||
|
if (ret >= 0x40000000) {
|
||||||
|
av_log(NULL, AV_LOG_ERROR, "dirac_get_arith_uint overflow\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
ret <<= 1;
|
ret <<= 1;
|
||||||
ret += dirac_get_arith_bit(c, data_ctx);
|
ret += dirac_get_arith_bit(c, data_ctx);
|
||||||
follow_ctx = ff_dirac_next_ctx[follow_ctx];
|
follow_ctx = ff_dirac_next_ctx[follow_ctx];
|
||||||
|
@ -612,10 +612,10 @@ static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b
|
|||||||
|
|
||||||
top = 0;
|
top = 0;
|
||||||
for (cb_y = 0; cb_y < cb_height; cb_y++) {
|
for (cb_y = 0; cb_y < cb_height; cb_y++) {
|
||||||
bottom = (b->height * (cb_y+1)) / cb_height;
|
bottom = (b->height * (cb_y+1LL)) / cb_height;
|
||||||
left = 0;
|
left = 0;
|
||||||
for (cb_x = 0; cb_x < cb_width; cb_x++) {
|
for (cb_x = 0; cb_x < cb_width; cb_x++) {
|
||||||
right = (b->width * (cb_x+1)) / cb_width;
|
right = (b->width * (cb_x+1LL)) / cb_width;
|
||||||
codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith);
|
codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith);
|
||||||
left = right;
|
left = right;
|
||||||
}
|
}
|
||||||
@ -1004,8 +1004,8 @@ static int dirac_unpack_idwt_params(DiracContext *s)
|
|||||||
/* Codeblock parameters (core syntax only) */
|
/* Codeblock parameters (core syntax only) */
|
||||||
if (get_bits1(gb)) {
|
if (get_bits1(gb)) {
|
||||||
for (i = 0; i <= s->wavelet_depth; i++) {
|
for (i = 0; i <= s->wavelet_depth; i++) {
|
||||||
CHECKEDREAD(s->codeblock[i].width , tmp < 1, "codeblock width invalid\n")
|
CHECKEDREAD(s->codeblock[i].width , tmp < 1 || tmp > (s->avctx->width >>s->wavelet_depth-i), "codeblock width invalid\n")
|
||||||
CHECKEDREAD(s->codeblock[i].height, tmp < 1, "codeblock height invalid\n")
|
CHECKEDREAD(s->codeblock[i].height, tmp < 1 || tmp > (s->avctx->height>>s->wavelet_depth-i), "codeblock height invalid\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n")
|
CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n")
|
||||||
|
@ -38,6 +38,7 @@ typedef struct DNXHDContext {
|
|||||||
BlockDSPContext bdsp;
|
BlockDSPContext bdsp;
|
||||||
int64_t cid; ///< compression id
|
int64_t cid; ///< compression id
|
||||||
unsigned int width, height;
|
unsigned int width, height;
|
||||||
|
enum AVPixelFormat pix_fmt;
|
||||||
unsigned int mb_width, mb_height;
|
unsigned int mb_width, mb_height;
|
||||||
uint32_t mb_scan_index[68]; /* max for 1080p */
|
uint32_t mb_scan_index[68]; /* max for 1080p */
|
||||||
int cur_field; ///< current interlaced field
|
int cur_field; ///< current interlaced field
|
||||||
@ -141,7 +142,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
|
|||||||
|
|
||||||
ctx->is_444 = 0;
|
ctx->is_444 = 0;
|
||||||
if (buf[0x4] == 0x2) {
|
if (buf[0x4] == 0x2) {
|
||||||
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
|
ctx->pix_fmt = AV_PIX_FMT_YUV444P10;
|
||||||
ctx->avctx->bits_per_raw_sample = 10;
|
ctx->avctx->bits_per_raw_sample = 10;
|
||||||
if (ctx->bit_depth != 10) {
|
if (ctx->bit_depth != 10) {
|
||||||
ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
|
ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
|
||||||
@ -151,7 +152,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
|
|||||||
}
|
}
|
||||||
ctx->is_444 = 1;
|
ctx->is_444 = 1;
|
||||||
} else if (buf[0x21] & 0x40) {
|
} else if (buf[0x21] & 0x40) {
|
||||||
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
|
ctx->pix_fmt = AV_PIX_FMT_YUV422P10;
|
||||||
ctx->avctx->bits_per_raw_sample = 10;
|
ctx->avctx->bits_per_raw_sample = 10;
|
||||||
if (ctx->bit_depth != 10) {
|
if (ctx->bit_depth != 10) {
|
||||||
ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
|
ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
|
||||||
@ -160,7 +161,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
|
|||||||
ctx->decode_dct_block = dnxhd_decode_dct_block_10;
|
ctx->decode_dct_block = dnxhd_decode_dct_block_10;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
|
ctx->pix_fmt = AV_PIX_FMT_YUV422P;
|
||||||
ctx->avctx->bits_per_raw_sample = 8;
|
ctx->avctx->bits_per_raw_sample = 8;
|
||||||
if (ctx->bit_depth != 8) {
|
if (ctx->bit_depth != 8) {
|
||||||
ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
|
ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
|
||||||
@ -446,7 +447,13 @@ decode_coding_unit:
|
|||||||
avctx->width, avctx->height, ctx->width, ctx->height);
|
avctx->width, avctx->height, ctx->width, ctx->height);
|
||||||
first_field = 1;
|
first_field = 1;
|
||||||
}
|
}
|
||||||
|
if (avctx->pix_fmt != AV_PIX_FMT_NONE && avctx->pix_fmt != ctx->pix_fmt) {
|
||||||
|
av_log(avctx, AV_LOG_WARNING, "pix_fmt changed: %s -> %s\n",
|
||||||
|
av_get_pix_fmt_name(avctx->pix_fmt), av_get_pix_fmt_name(ctx->pix_fmt));
|
||||||
|
first_field = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
avctx->pix_fmt = ctx->pix_fmt;
|
||||||
ret = ff_set_dimensions(avctx, ctx->width, ctx->height);
|
ret = ff_set_dimensions(avctx, ctx->width, ctx->height);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -37,7 +37,7 @@ typedef struct DVDSubContext
|
|||||||
int has_palette;
|
int has_palette;
|
||||||
uint8_t colormap[4];
|
uint8_t colormap[4];
|
||||||
uint8_t alpha[256];
|
uint8_t alpha[256];
|
||||||
uint8_t *buf;
|
uint8_t buf[0x10000];
|
||||||
int buf_size;
|
int buf_size;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
int sub_id;
|
int sub_id;
|
||||||
@ -105,6 +105,12 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
|
|||||||
int x, y, len, color;
|
int x, y, len, color;
|
||||||
uint8_t *d;
|
uint8_t *d;
|
||||||
|
|
||||||
|
if (start >= buf_size)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (w <= 0 || h <= 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
bit_len = (buf_size - start) * 8;
|
bit_len = (buf_size - start) * 8;
|
||||||
init_get_bits(&gb, buf + start, bit_len);
|
init_get_bits(&gb, buf + start, bit_len);
|
||||||
|
|
||||||
@ -356,10 +362,12 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
|||||||
sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
|
sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
|
||||||
sub_header->num_rects = 1;
|
sub_header->num_rects = 1;
|
||||||
sub_header->rects[0]->pict.data[0] = bitmap;
|
sub_header->rects[0]->pict.data[0] = bitmap;
|
||||||
decode_rle(bitmap, w * 2, w, (h + 1) / 2,
|
if (decode_rle(bitmap, w * 2, w, (h + 1) / 2,
|
||||||
buf, offset1, buf_size, is_8bit);
|
buf, offset1, buf_size, is_8bit) < 0)
|
||||||
decode_rle(bitmap + w, w * 2, w, h / 2,
|
goto fail;
|
||||||
buf, offset2, buf_size, is_8bit);
|
if (decode_rle(bitmap + w, w * 2, w, h / 2,
|
||||||
|
buf, offset2, buf_size, is_8bit) < 0)
|
||||||
|
goto fail;
|
||||||
sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
|
sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
|
||||||
if (is_8bit) {
|
if (is_8bit) {
|
||||||
if (!yuv_palette)
|
if (!yuv_palette)
|
||||||
@ -498,15 +506,11 @@ static int append_to_cached_buf(AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
DVDSubContext *ctx = avctx->priv_data;
|
DVDSubContext *ctx = avctx->priv_data;
|
||||||
|
|
||||||
if (ctx->buf_size > 0xffff - buf_size) {
|
if (ctx->buf_size >= sizeof(ctx->buf) - buf_size) {
|
||||||
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
|
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
|
||||||
"too large SPU packets aborted.\n");
|
"too large SPU packets aborted.\n");
|
||||||
av_freep(&ctx->buf);
|
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
ctx->buf = av_realloc(ctx->buf, ctx->buf_size + buf_size);
|
|
||||||
if (!ctx->buf)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
memcpy(ctx->buf + ctx->buf_size, buf, buf_size);
|
memcpy(ctx->buf + ctx->buf_size, buf, buf_size);
|
||||||
ctx->buf_size += buf_size;
|
ctx->buf_size += buf_size;
|
||||||
return 0;
|
return 0;
|
||||||
@ -522,7 +526,7 @@ static int dvdsub_decode(AVCodecContext *avctx,
|
|||||||
AVSubtitle *sub = data;
|
AVSubtitle *sub = data;
|
||||||
int is_menu;
|
int is_menu;
|
||||||
|
|
||||||
if (ctx->buf) {
|
if (ctx->buf_size) {
|
||||||
int ret = append_to_cached_buf(avctx, buf, buf_size);
|
int ret = append_to_cached_buf(avctx, buf, buf_size);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
*data_size = 0;
|
*data_size = 0;
|
||||||
@ -561,7 +565,6 @@ static int dvdsub_decode(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
av_freep(&ctx->buf);
|
|
||||||
ctx->buf_size = 0;
|
ctx->buf_size = 0;
|
||||||
*data_size = 1;
|
*data_size = 1;
|
||||||
return buf_size;
|
return buf_size;
|
||||||
@ -643,7 +646,6 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
|
|||||||
static av_cold int dvdsub_close(AVCodecContext *avctx)
|
static av_cold int dvdsub_close(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
DVDSubContext *ctx = avctx->priv_data;
|
DVDSubContext *ctx = avctx->priv_data;
|
||||||
av_freep(&ctx->buf);
|
|
||||||
ctx->buf_size = 0;
|
ctx->buf_size = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -329,6 +329,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
DxaDecContext * const c = avctx->priv_data;
|
DxaDecContext * const c = avctx->priv_data;
|
||||||
|
|
||||||
|
if (avctx->width%4 || avctx->height%4) {
|
||||||
|
avpriv_request_sample(avctx, "dimensions are not a multiple of 4");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
c->prev = av_frame_alloc();
|
c->prev = av_frame_alloc();
|
||||||
if (!c->prev)
|
if (!c->prev)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
@ -473,10 +473,10 @@ static int decode_frame(FLACContext *s)
|
|||||||
ret = allocate_buffers(s);
|
ret = allocate_buffers(s);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
|
|
||||||
s->got_streaminfo = 1;
|
s->got_streaminfo = 1;
|
||||||
dump_headers(s->avctx, (FLACStreaminfo *)s);
|
dump_headers(s->avctx, (FLACStreaminfo *)s);
|
||||||
}
|
}
|
||||||
|
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
|
||||||
|
|
||||||
// dump_headers(s->avctx, (FLACStreaminfo *)s);
|
// dump_headers(s->avctx, (FLACStreaminfo *)s);
|
||||||
|
|
||||||
|
@ -736,8 +736,10 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
}
|
}
|
||||||
c->tile_width = bytestream2_get_be32(&bc);
|
c->tile_width = bytestream2_get_be32(&bc);
|
||||||
c->tile_height = bytestream2_get_be32(&bc);
|
c->tile_height = bytestream2_get_be32(&bc);
|
||||||
if (!c->tile_width || !c->tile_height ||
|
if (c->tile_width <= 0 || c->tile_height <= 0 ||
|
||||||
((c->tile_width | c->tile_height) & 0xF)) {
|
((c->tile_width | c->tile_height) & 0xF) ||
|
||||||
|
c->tile_width * 4LL * c->tile_height >= INT_MAX
|
||||||
|
) {
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Invalid tile dimensions %dx%d\n",
|
"Invalid tile dimensions %dx%d\n",
|
||||||
c->tile_width, c->tile_height);
|
c->tile_width, c->tile_height);
|
||||||
|
@ -271,26 +271,21 @@ static int gif_read_image(GifState *s, AVFrame *frame)
|
|||||||
case 1:
|
case 1:
|
||||||
y1 += 8;
|
y1 += 8;
|
||||||
ptr += linesize * 8;
|
ptr += linesize * 8;
|
||||||
if (y1 >= height) {
|
|
||||||
y1 = pass ? 2 : 4;
|
|
||||||
ptr = ptr1 + linesize * y1;
|
|
||||||
pass++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
y1 += 4;
|
y1 += 4;
|
||||||
ptr += linesize * 4;
|
ptr += linesize * 4;
|
||||||
if (y1 >= height) {
|
|
||||||
y1 = 1;
|
|
||||||
ptr = ptr1 + linesize;
|
|
||||||
pass++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
y1 += 2;
|
y1 += 2;
|
||||||
ptr += linesize * 2;
|
ptr += linesize * 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
while (y1 >= height) {
|
||||||
|
y1 = 4 >> pass;
|
||||||
|
ptr = ptr1 + linesize * y1;
|
||||||
|
pass++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ptr += linesize;
|
ptr += linesize;
|
||||||
}
|
}
|
||||||
|
@ -336,6 +336,14 @@ static int decode_slice(MpegEncContext *s)
|
|||||||
s->padding_bug_score += 32;
|
s->padding_bug_score += 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (s->codec_id == AV_CODEC_ID_H263 &&
|
||||||
|
(s->workaround_bugs & FF_BUG_AUTODETECT) &&
|
||||||
|
get_bits_left(&s->gb) >= 64 &&
|
||||||
|
AV_RB64(s->gb.buffer_end - 8) == 0xCDCDCDCDFC7F0000) {
|
||||||
|
|
||||||
|
s->padding_bug_score += 32;
|
||||||
|
}
|
||||||
|
|
||||||
if (s->workaround_bugs & FF_BUG_AUTODETECT) {
|
if (s->workaround_bugs & FF_BUG_AUTODETECT) {
|
||||||
if (s->padding_bug_score > -2 && !s->data_partitioning)
|
if (s->padding_bug_score > -2 && !s->data_partitioning)
|
||||||
s->workaround_bugs |= FF_BUG_NO_PADDING;
|
s->workaround_bugs |= FF_BUG_NO_PADDING;
|
||||||
|
@ -215,18 +215,18 @@ int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma)
|
|||||||
|
|
||||||
if ((h->left_samples_available & 0x8080) != 0x8080) {
|
if ((h->left_samples_available & 0x8080) != 0x8080) {
|
||||||
mode = left[mode];
|
mode = left[mode];
|
||||||
if (is_chroma && (h->left_samples_available & 0x8080)) {
|
|
||||||
// mad cow disease mode, aka MBAFF + constrained_intra_pred
|
|
||||||
mode = ALZHEIMER_DC_L0T_PRED8x8 +
|
|
||||||
(!(h->left_samples_available & 0x8000)) +
|
|
||||||
2 * (mode == DC_128_PRED8x8);
|
|
||||||
}
|
|
||||||
if (mode < 0) {
|
if (mode < 0) {
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
"left block unavailable for requested intra mode at %d %d\n",
|
"left block unavailable for requested intra mode at %d %d\n",
|
||||||
h->mb_x, h->mb_y);
|
h->mb_x, h->mb_y);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
if (is_chroma && (h->left_samples_available & 0x8080)) {
|
||||||
|
// mad cow disease mode, aka MBAFF + constrained_intra_pred
|
||||||
|
mode = ALZHEIMER_DC_L0T_PRED8x8 +
|
||||||
|
(!(h->left_samples_available & 0x8000)) +
|
||||||
|
2 * (mode == DC_128_PRED8x8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return mode;
|
return mode;
|
||||||
@ -391,6 +391,7 @@ void ff_h264_free_tables(H264Context *h, int free_rbsp)
|
|||||||
if (free_rbsp && h->DPB) {
|
if (free_rbsp && h->DPB) {
|
||||||
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
||||||
ff_h264_unref_picture(h, &h->DPB[i]);
|
ff_h264_unref_picture(h, &h->DPB[i]);
|
||||||
|
memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
|
||||||
av_freep(&h->DPB);
|
av_freep(&h->DPB);
|
||||||
} else if (h->DPB) {
|
} else if (h->DPB) {
|
||||||
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
||||||
@ -990,6 +991,16 @@ int ff_pred_weight_table(H264Context *h)
|
|||||||
h->luma_log2_weight_denom = get_ue_golomb(&h->gb);
|
h->luma_log2_weight_denom = get_ue_golomb(&h->gb);
|
||||||
if (h->sps.chroma_format_idc)
|
if (h->sps.chroma_format_idc)
|
||||||
h->chroma_log2_weight_denom = get_ue_golomb(&h->gb);
|
h->chroma_log2_weight_denom = get_ue_golomb(&h->gb);
|
||||||
|
|
||||||
|
if (h->luma_log2_weight_denom > 7U) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is out of range\n", h->luma_log2_weight_denom);
|
||||||
|
h->luma_log2_weight_denom = 0;
|
||||||
|
}
|
||||||
|
if (h->chroma_log2_weight_denom > 7U) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR, "chroma_log2_weight_denom %d is out of range\n", h->chroma_log2_weight_denom);
|
||||||
|
h->chroma_log2_weight_denom = 0;
|
||||||
|
}
|
||||||
|
|
||||||
luma_def = 1 << h->luma_log2_weight_denom;
|
luma_def = 1 << h->luma_log2_weight_denom;
|
||||||
chroma_def = 1 << h->chroma_log2_weight_denom;
|
chroma_def = 1 << h->chroma_log2_weight_denom;
|
||||||
|
|
||||||
@ -1330,43 +1341,6 @@ int ff_set_ref_count(H264Context *h)
|
|||||||
|
|
||||||
static const uint8_t start_code[] = { 0x00, 0x00, 0x01 };
|
static const uint8_t start_code[] = { 0x00, 0x00, 0x01 };
|
||||||
|
|
||||||
static int find_start_code(const uint8_t *buf, int buf_size,
|
|
||||||
int buf_index, int next_avc)
|
|
||||||
{
|
|
||||||
// start code prefix search
|
|
||||||
for (; buf_index + 3 < next_avc; buf_index++)
|
|
||||||
// This should always succeed in the first iteration.
|
|
||||||
if (buf[buf_index] == 0 &&
|
|
||||||
buf[buf_index + 1] == 0 &&
|
|
||||||
buf[buf_index + 2] == 1)
|
|
||||||
break;
|
|
||||||
|
|
||||||
buf_index += 3;
|
|
||||||
|
|
||||||
if (buf_index >= buf_size)
|
|
||||||
return buf_size;
|
|
||||||
|
|
||||||
return buf_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_avc_nalsize(H264Context *h, const uint8_t *buf,
|
|
||||||
int buf_size, int *buf_index)
|
|
||||||
{
|
|
||||||
int i, nalsize = 0;
|
|
||||||
|
|
||||||
if (*buf_index >= buf_size - h->nal_length_size)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
for (i = 0; i < h->nal_length_size; i++)
|
|
||||||
nalsize = (nalsize << 8) | buf[(*buf_index)++];
|
|
||||||
if (nalsize <= 0 || nalsize > buf_size - *buf_index) {
|
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
|
||||||
"AVC: nal size %d\n", nalsize);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return nalsize;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int get_bit_length(H264Context *h, const uint8_t *buf,
|
static int get_bit_length(H264Context *h, const uint8_t *buf,
|
||||||
const uint8_t *ptr, int dst_length,
|
const uint8_t *ptr, int dst_length,
|
||||||
int i, int next_avc)
|
int i, int next_avc)
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "h264dsp.h"
|
#include "h264dsp.h"
|
||||||
#include "h264pred.h"
|
#include "h264pred.h"
|
||||||
#include "h264qpel.h"
|
#include "h264qpel.h"
|
||||||
|
#include "internal.h" // for avpriv_find_start_code()
|
||||||
#include "me_cmp.h"
|
#include "me_cmp.h"
|
||||||
#include "mpegutils.h"
|
#include "mpegutils.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
@ -337,6 +338,7 @@ typedef struct H264Picture {
|
|||||||
* H264Context
|
* H264Context
|
||||||
*/
|
*/
|
||||||
typedef struct H264Context {
|
typedef struct H264Context {
|
||||||
|
AVClass *av_class;
|
||||||
AVCodecContext *avctx;
|
AVCodecContext *avctx;
|
||||||
MECmpContext mecc;
|
MECmpContext mecc;
|
||||||
VideoDSPContext vdsp;
|
VideoDSPContext vdsp;
|
||||||
@ -1092,6 +1094,34 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h)
|
|||||||
0x0001000100010001ULL));
|
0x0001000100010001ULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int find_start_code(const uint8_t *buf, int buf_size,
|
||||||
|
int buf_index, int next_avc)
|
||||||
|
{
|
||||||
|
uint32_t state = -1;
|
||||||
|
|
||||||
|
buf_index = avpriv_find_start_code(buf + buf_index, buf + next_avc + 1, &state) - buf - 1;
|
||||||
|
|
||||||
|
return FFMIN(buf_index, buf_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf,
|
||||||
|
int buf_size, int *buf_index)
|
||||||
|
{
|
||||||
|
int i, nalsize = 0;
|
||||||
|
|
||||||
|
if (*buf_index >= buf_size - h->nal_length_size)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
for (i = 0; i < h->nal_length_size; i++)
|
||||||
|
nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++];
|
||||||
|
if (nalsize <= 0 || nalsize > buf_size - *buf_index) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
|
"AVC: nal size %d\n", nalsize);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return nalsize;
|
||||||
|
}
|
||||||
|
|
||||||
int ff_h264_field_end(H264Context *h, int in_setup);
|
int ff_h264_field_end(H264Context *h, int in_setup);
|
||||||
|
|
||||||
int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src);
|
int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src);
|
||||||
|
@ -202,10 +202,10 @@ static int scan_mmco_reset(AVCodecParserContext *s)
|
|||||||
*/
|
*/
|
||||||
static inline int parse_nal_units(AVCodecParserContext *s,
|
static inline int parse_nal_units(AVCodecParserContext *s,
|
||||||
AVCodecContext *avctx,
|
AVCodecContext *avctx,
|
||||||
const uint8_t *buf, int buf_size)
|
const uint8_t * const buf, int buf_size)
|
||||||
{
|
{
|
||||||
H264Context *h = s->priv_data;
|
H264Context *h = s->priv_data;
|
||||||
const uint8_t *buf_end = buf + buf_size;
|
int buf_index, next_avc;
|
||||||
unsigned int pps_id;
|
unsigned int pps_id;
|
||||||
unsigned int slice_type;
|
unsigned int slice_type;
|
||||||
int state = -1, got_reset = 0;
|
int state = -1, got_reset = 0;
|
||||||
@ -225,26 +225,26 @@ static inline int parse_nal_units(AVCodecParserContext *s,
|
|||||||
if (!buf_size)
|
if (!buf_size)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
buf_index = 0;
|
||||||
|
next_avc = h->is_avc ? 0 : buf_size;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int src_length, dst_length, consumed, nalsize = 0;
|
int src_length, dst_length, consumed, nalsize = 0;
|
||||||
if (h->is_avc) {
|
|
||||||
int i;
|
if (buf_index >= next_avc) {
|
||||||
if (h->nal_length_size >= buf_end - buf) break;
|
nalsize = get_avc_nalsize(h, buf, buf_size, &buf_index);
|
||||||
nalsize = 0;
|
if (nalsize < 0)
|
||||||
for (i = 0; i < h->nal_length_size; i++)
|
|
||||||
nalsize = (nalsize << 8) | *buf++;
|
|
||||||
if (nalsize <= 0 || nalsize > buf_end - buf) {
|
|
||||||
av_log(h->avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize);
|
|
||||||
break;
|
break;
|
||||||
}
|
next_avc = buf_index + nalsize;
|
||||||
src_length = nalsize;
|
|
||||||
} else {
|
} else {
|
||||||
buf = avpriv_find_start_code(buf, buf_end, &state);
|
buf_index = find_start_code(buf, buf_size, buf_index, next_avc);
|
||||||
if (buf >= buf_end)
|
if (buf_index >= buf_size)
|
||||||
break;
|
break;
|
||||||
--buf;
|
if (buf_index >= next_avc)
|
||||||
src_length = buf_end - buf;
|
continue;
|
||||||
}
|
}
|
||||||
|
src_length = next_avc - buf_index;
|
||||||
|
|
||||||
|
state = buf[buf_index];
|
||||||
switch (state & 0x1f) {
|
switch (state & 0x1f) {
|
||||||
case NAL_SLICE:
|
case NAL_SLICE:
|
||||||
case NAL_IDR_SLICE:
|
case NAL_IDR_SLICE:
|
||||||
@ -261,10 +261,13 @@ static inline int parse_nal_units(AVCodecParserContext *s,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length);
|
ptr = ff_h264_decode_nal(h, buf + buf_index, &dst_length,
|
||||||
|
&consumed, src_length);
|
||||||
if (!ptr || dst_length < 0)
|
if (!ptr || dst_length < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
buf_index += consumed;
|
||||||
|
|
||||||
init_get_bits(&h->gb, ptr, 8 * dst_length);
|
init_get_bits(&h->gb, ptr, 8 * dst_length);
|
||||||
switch (h->nal_unit_type) {
|
switch (h->nal_unit_type) {
|
||||||
case NAL_SPS:
|
case NAL_SPS:
|
||||||
@ -439,7 +442,6 @@ static inline int parse_nal_units(AVCodecParserContext *s,
|
|||||||
|
|
||||||
return 0; /* no need to evaluate the rest */
|
return 0; /* no need to evaluate the rest */
|
||||||
}
|
}
|
||||||
buf += h->is_avc ? nalsize : consumed;
|
|
||||||
}
|
}
|
||||||
if (q264)
|
if (q264)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -281,7 +281,7 @@ static int decode_display_orientation(H264Context *h)
|
|||||||
|
|
||||||
int ff_h264_decode_sei(H264Context *h)
|
int ff_h264_decode_sei(H264Context *h)
|
||||||
{
|
{
|
||||||
while (get_bits_left(&h->gb) > 16) {
|
while (get_bits_left(&h->gb) > 16 && show_bits(&h->gb, 16)) {
|
||||||
int type = 0;
|
int type = 0;
|
||||||
unsigned size = 0;
|
unsigned size = 0;
|
||||||
unsigned next;
|
unsigned next;
|
||||||
|
@ -585,6 +585,17 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
|
|||||||
h->mb_type_pool = NULL;
|
h->mb_type_pool = NULL;
|
||||||
h->ref_index_pool = NULL;
|
h->ref_index_pool = NULL;
|
||||||
h->motion_val_pool = NULL;
|
h->motion_val_pool = NULL;
|
||||||
|
h->intra4x4_pred_mode= NULL;
|
||||||
|
h->non_zero_count = NULL;
|
||||||
|
h->slice_table_base = NULL;
|
||||||
|
h->slice_table = NULL;
|
||||||
|
h->cbp_table = NULL;
|
||||||
|
h->chroma_pred_mode_table = NULL;
|
||||||
|
memset(h->mvd_table, 0, sizeof(h->mvd_table));
|
||||||
|
h->direct_table = NULL;
|
||||||
|
h->list_counts = NULL;
|
||||||
|
h->mb2b_xy = NULL;
|
||||||
|
h->mb2br_xy = NULL;
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
h->rbsp_buffer[i] = NULL;
|
h->rbsp_buffer[i] = NULL;
|
||||||
h->rbsp_buffer_size[i] = 0;
|
h->rbsp_buffer_size[i] = 0;
|
||||||
@ -1025,76 +1036,79 @@ static int clone_slice(H264Context *dst, H264Context *src)
|
|||||||
|
|
||||||
static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
|
static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
|
||||||
{
|
{
|
||||||
|
enum AVPixelFormat pix_fmts[2];
|
||||||
|
const enum AVPixelFormat *choices = pix_fmts;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
pix_fmts[1] = AV_PIX_FMT_NONE;
|
||||||
|
|
||||||
switch (h->sps.bit_depth_luma) {
|
switch (h->sps.bit_depth_luma) {
|
||||||
case 9:
|
case 9:
|
||||||
if (CHROMA444(h)) {
|
if (CHROMA444(h)) {
|
||||||
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
|
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
|
||||||
return AV_PIX_FMT_GBRP9;
|
pix_fmts[0] = AV_PIX_FMT_GBRP9;
|
||||||
} else
|
} else
|
||||||
return AV_PIX_FMT_YUV444P9;
|
pix_fmts[0] = AV_PIX_FMT_YUV444P9;
|
||||||
} else if (CHROMA422(h))
|
} else if (CHROMA422(h))
|
||||||
return AV_PIX_FMT_YUV422P9;
|
pix_fmts[0] = AV_PIX_FMT_YUV422P9;
|
||||||
else
|
else
|
||||||
return AV_PIX_FMT_YUV420P9;
|
pix_fmts[0] = AV_PIX_FMT_YUV420P9;
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
if (CHROMA444(h)) {
|
if (CHROMA444(h)) {
|
||||||
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
|
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
|
||||||
return AV_PIX_FMT_GBRP10;
|
pix_fmts[0] = AV_PIX_FMT_GBRP10;
|
||||||
} else
|
} else
|
||||||
return AV_PIX_FMT_YUV444P10;
|
pix_fmts[0] = AV_PIX_FMT_YUV444P10;
|
||||||
} else if (CHROMA422(h))
|
} else if (CHROMA422(h))
|
||||||
return AV_PIX_FMT_YUV422P10;
|
pix_fmts[0] = AV_PIX_FMT_YUV422P10;
|
||||||
else
|
else
|
||||||
return AV_PIX_FMT_YUV420P10;
|
pix_fmts[0] = AV_PIX_FMT_YUV420P10;
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
if (CHROMA444(h)) {
|
if (CHROMA444(h)) {
|
||||||
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
|
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
|
||||||
return AV_PIX_FMT_GBRP12;
|
pix_fmts[0] = AV_PIX_FMT_GBRP12;
|
||||||
} else
|
} else
|
||||||
return AV_PIX_FMT_YUV444P12;
|
pix_fmts[0] = AV_PIX_FMT_YUV444P12;
|
||||||
} else if (CHROMA422(h))
|
} else if (CHROMA422(h))
|
||||||
return AV_PIX_FMT_YUV422P12;
|
pix_fmts[0] = AV_PIX_FMT_YUV422P12;
|
||||||
else
|
else
|
||||||
return AV_PIX_FMT_YUV420P12;
|
pix_fmts[0] = AV_PIX_FMT_YUV420P12;
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
if (CHROMA444(h)) {
|
if (CHROMA444(h)) {
|
||||||
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
|
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
|
||||||
return AV_PIX_FMT_GBRP14;
|
pix_fmts[0] = AV_PIX_FMT_GBRP14;
|
||||||
} else
|
} else
|
||||||
return AV_PIX_FMT_YUV444P14;
|
pix_fmts[0] = AV_PIX_FMT_YUV444P14;
|
||||||
} else if (CHROMA422(h))
|
} else if (CHROMA422(h))
|
||||||
return AV_PIX_FMT_YUV422P14;
|
pix_fmts[0] = AV_PIX_FMT_YUV422P14;
|
||||||
else
|
else
|
||||||
return AV_PIX_FMT_YUV420P14;
|
pix_fmts[0] = AV_PIX_FMT_YUV420P14;
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (CHROMA444(h)) {
|
if (CHROMA444(h)) {
|
||||||
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
|
if (h->avctx->colorspace == AVCOL_SPC_YCGCO)
|
||||||
av_log(h->avctx, AV_LOG_DEBUG, "Detected GBR colorspace.\n");
|
|
||||||
return AV_PIX_FMT_GBR24P;
|
|
||||||
} else if (h->avctx->colorspace == AVCOL_SPC_YCGCO) {
|
|
||||||
av_log(h->avctx, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n");
|
av_log(h->avctx, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n");
|
||||||
}
|
if (h->avctx->colorspace == AVCOL_SPC_RGB)
|
||||||
return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ444P
|
pix_fmts[0] = AV_PIX_FMT_GBRP;
|
||||||
: AV_PIX_FMT_YUV444P;
|
else if (h->avctx->color_range == AVCOL_RANGE_JPEG)
|
||||||
|
pix_fmts[0] = AV_PIX_FMT_YUVJ444P;
|
||||||
|
else
|
||||||
|
pix_fmts[0] = AV_PIX_FMT_YUV444P;
|
||||||
} else if (CHROMA422(h)) {
|
} else if (CHROMA422(h)) {
|
||||||
return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P
|
if (h->avctx->color_range == AVCOL_RANGE_JPEG)
|
||||||
: AV_PIX_FMT_YUV422P;
|
pix_fmts[0] = AV_PIX_FMT_YUVJ422P;
|
||||||
|
else
|
||||||
|
pix_fmts[0] = AV_PIX_FMT_YUV422P;
|
||||||
} else {
|
} else {
|
||||||
int i;
|
if (h->avctx->codec->pix_fmts)
|
||||||
const enum AVPixelFormat * fmt = h->avctx->codec->pix_fmts ?
|
choices = h->avctx->codec->pix_fmts;
|
||||||
h->avctx->codec->pix_fmts :
|
else if (h->avctx->color_range == AVCOL_RANGE_JPEG)
|
||||||
h->avctx->color_range == AVCOL_RANGE_JPEG ?
|
choices = h264_hwaccel_pixfmt_list_jpeg_420;
|
||||||
h264_hwaccel_pixfmt_list_jpeg_420 :
|
else
|
||||||
h264_hwaccel_pixfmt_list_420;
|
choices = h264_hwaccel_pixfmt_list_420;
|
||||||
|
|
||||||
for (i=0; fmt[i] != AV_PIX_FMT_NONE; i++)
|
|
||||||
if (fmt[i] == h->avctx->pix_fmt && !force_callback)
|
|
||||||
return fmt[i];
|
|
||||||
return ff_thread_get_format(h->avctx, fmt);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1102,6 +1116,11 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
|
|||||||
"Unsupported bit depth %d\n", h->sps.bit_depth_luma);
|
"Unsupported bit depth %d\n", h->sps.bit_depth_luma);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i=0; choices[i] != AV_PIX_FMT_NONE; i++)
|
||||||
|
if (choices[i] == h->avctx->pix_fmt && !force_callback)
|
||||||
|
return choices[i];
|
||||||
|
return ff_thread_get_format(h->avctx, choices);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* export coded and cropped frame dimensions to AVCodecContext */
|
/* export coded and cropped frame dimensions to AVCodecContext */
|
||||||
|
@ -108,7 +108,7 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps)
|
|||||||
if (!s->tab_ipm || !s->cbf_luma || !s->is_pcm)
|
if (!s->tab_ipm || !s->cbf_luma || !s->is_pcm)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
s->filter_slice_edges = av_malloc(ctb_count);
|
s->filter_slice_edges = av_mallocz(ctb_count);
|
||||||
s->tab_slice_address = av_malloc_array(pic_size_in_ctb,
|
s->tab_slice_address = av_malloc_array(pic_size_in_ctb,
|
||||||
sizeof(*s->tab_slice_address));
|
sizeof(*s->tab_slice_address));
|
||||||
s->qp_y_tab = av_malloc_array(pic_size_in_ctb,
|
s->qp_y_tab = av_malloc_array(pic_size_in_ctb,
|
||||||
@ -981,7 +981,7 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
|
|||||||
for (i = 0; i < (size * size); i++) {
|
for (i = 0; i < (size * size); i++) {
|
||||||
coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3);
|
coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3);
|
||||||
}
|
}
|
||||||
s->hevcdsp.transform_add[log2_trafo_size-2](dst, coeffs, stride);
|
s->hevcdsp.transform_add[log2_trafo_size_c-2](dst, coeffs, stride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1010,7 +1010,7 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0,
|
|||||||
for (i = 0; i < (size * size); i++) {
|
for (i = 0; i < (size * size); i++) {
|
||||||
coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3);
|
coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3);
|
||||||
}
|
}
|
||||||
s->hevcdsp.transform_add[log2_trafo_size-2](dst, coeffs, stride);
|
s->hevcdsp.transform_add[log2_trafo_size_c-2](dst, coeffs, stride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (blk_idx == 3) {
|
} else if (blk_idx == 3) {
|
||||||
|
@ -227,8 +227,10 @@ static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0,
|
|||||||
|
|
||||||
HEVCFrame *ref = s->ref->collocated_ref;
|
HEVCFrame *ref = s->ref->collocated_ref;
|
||||||
|
|
||||||
if (!ref)
|
if (!ref) {
|
||||||
|
memset(mvLXCol, 0, sizeof(*mvLXCol));
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
tab_mvf = ref->tab_mvf;
|
tab_mvf = ref->tab_mvf;
|
||||||
colPic = ref->poc;
|
colPic = ref->poc;
|
||||||
@ -415,14 +417,10 @@ static void derive_spatial_merge_candidates(HEVCContext *s, int x0, int y0,
|
|||||||
|
|
||||||
if (available_l0 || available_l1) {
|
if (available_l0 || available_l1) {
|
||||||
mergecandlist[nb_merge_cand].pred_flag = available_l0 + (available_l1 << 1);
|
mergecandlist[nb_merge_cand].pred_flag = available_l0 + (available_l1 << 1);
|
||||||
if (available_l0) {
|
AV_ZERO16(mergecandlist[nb_merge_cand].ref_idx);
|
||||||
mergecandlist[nb_merge_cand].mv[0] = mv_l0_col;
|
mergecandlist[nb_merge_cand].mv[0] = mv_l0_col;
|
||||||
mergecandlist[nb_merge_cand].ref_idx[0] = 0;
|
mergecandlist[nb_merge_cand].mv[1] = mv_l1_col;
|
||||||
}
|
|
||||||
if (available_l1) {
|
|
||||||
mergecandlist[nb_merge_cand].mv[1] = mv_l1_col;
|
|
||||||
mergecandlist[nb_merge_cand].ref_idx[1] = 0;
|
|
||||||
}
|
|
||||||
if (merge_idx == nb_merge_cand)
|
if (merge_idx == nb_merge_cand)
|
||||||
return;
|
return;
|
||||||
nb_merge_cand++;
|
nb_merge_cand++;
|
||||||
|
@ -525,7 +525,11 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps)
|
|||||||
vui->field_seq_flag = get_bits1(gb);
|
vui->field_seq_flag = get_bits1(gb);
|
||||||
vui->frame_field_info_present_flag = get_bits1(gb);
|
vui->frame_field_info_present_flag = get_bits1(gb);
|
||||||
|
|
||||||
vui->default_display_window_flag = get_bits1(gb);
|
if (get_bits_left(gb) >= 68 && show_bits_long(gb, 21) == 0x100000) {
|
||||||
|
vui->default_display_window_flag = 0;
|
||||||
|
av_log(s->avctx, AV_LOG_WARNING, "Invalid default display window\n");
|
||||||
|
} else
|
||||||
|
vui->default_display_window_flag = get_bits1(gb);
|
||||||
// Backup context in case an alternate header is detected
|
// Backup context in case an alternate header is detected
|
||||||
memcpy(&backup, gb, sizeof(backup));
|
memcpy(&backup, gb, sizeof(backup));
|
||||||
|
|
||||||
@ -947,6 +951,11 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
|
|||||||
sps->long_term_ref_pics_present_flag = get_bits1(gb);
|
sps->long_term_ref_pics_present_flag = get_bits1(gb);
|
||||||
if (sps->long_term_ref_pics_present_flag) {
|
if (sps->long_term_ref_pics_present_flag) {
|
||||||
sps->num_long_term_ref_pics_sps = get_ue_golomb_long(gb);
|
sps->num_long_term_ref_pics_sps = get_ue_golomb_long(gb);
|
||||||
|
if (sps->num_long_term_ref_pics_sps > 31U) {
|
||||||
|
av_log(0, AV_LOG_ERROR, "num_long_term_ref_pics_sps %d is out of range.\n",
|
||||||
|
sps->num_long_term_ref_pics_sps);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
for (i = 0; i < sps->num_long_term_ref_pics_sps; i++) {
|
for (i = 0; i < sps->num_long_term_ref_pics_sps; i++) {
|
||||||
sps->lt_ref_pic_poc_lsb_sps[i] = get_bits(gb, sps->log2_max_poc_lsb);
|
sps->lt_ref_pic_poc_lsb_sps[i] = get_bits(gb, sps->log2_max_poc_lsb);
|
||||||
sps->used_by_curr_pic_lt_sps_flag[i] = get_bits1(gb);
|
sps->used_by_curr_pic_lt_sps_flag[i] = get_bits1(gb);
|
||||||
@ -1248,6 +1257,14 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
|
|||||||
if (pps->cu_qp_delta_enabled_flag)
|
if (pps->cu_qp_delta_enabled_flag)
|
||||||
pps->diff_cu_qp_delta_depth = get_ue_golomb_long(gb);
|
pps->diff_cu_qp_delta_depth = get_ue_golomb_long(gb);
|
||||||
|
|
||||||
|
if (pps->diff_cu_qp_delta_depth < 0 ||
|
||||||
|
pps->diff_cu_qp_delta_depth > sps->log2_diff_max_min_coding_block_size) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "diff_cu_qp_delta_depth %d is invalid\n",
|
||||||
|
pps->diff_cu_qp_delta_depth);
|
||||||
|
ret = AVERROR_INVALIDDATA;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
pps->cb_qp_offset = get_se_golomb(gb);
|
pps->cb_qp_offset = get_se_golomb(gb);
|
||||||
if (pps->cb_qp_offset < -12 || pps->cb_qp_offset > 12) {
|
if (pps->cb_qp_offset < -12 || pps->cb_qp_offset > 12) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "pps_cb_qp_offset out of range: %d\n",
|
av_log(s->avctx, AV_LOG_ERROR, "pps_cb_qp_offset out of range: %d\n",
|
||||||
@ -1371,7 +1388,8 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
|
|||||||
int pps_range_extensions_flag = get_bits1(gb);
|
int pps_range_extensions_flag = get_bits1(gb);
|
||||||
/* int pps_extension_7bits = */ get_bits(gb, 7);
|
/* int pps_extension_7bits = */ get_bits(gb, 7);
|
||||||
if (sps->ptl.general_ptl.profile_idc == FF_PROFILE_HEVC_REXT && pps_range_extensions_flag) {
|
if (sps->ptl.general_ptl.profile_idc == FF_PROFILE_HEVC_REXT && pps_range_extensions_flag) {
|
||||||
pps_range_extensions(s, pps, sps);
|
if ((ret = pps_range_extensions(s, pps, sps)) < 0)
|
||||||
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -887,14 +887,14 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
|
|||||||
|
|
||||||
flag = get_bits1(&q->gb);
|
flag = get_bits1(&q->gb);
|
||||||
if (stream_format_code & 0x1)
|
if (stream_format_code & 0x1)
|
||||||
imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf,
|
|
||||||
chctx->flcoeffs1, chctx->flcoeffs2);
|
|
||||||
else if (stream_format_code & 0x1)
|
|
||||||
imc_read_level_coeffs_raw(q, stream_format_code, chctx->levlCoeffBuf);
|
imc_read_level_coeffs_raw(q, stream_format_code, chctx->levlCoeffBuf);
|
||||||
else
|
else
|
||||||
imc_read_level_coeffs(q, stream_format_code, chctx->levlCoeffBuf);
|
imc_read_level_coeffs(q, stream_format_code, chctx->levlCoeffBuf);
|
||||||
|
|
||||||
if (stream_format_code & 0x4)
|
if (stream_format_code & 0x1)
|
||||||
|
imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf,
|
||||||
|
chctx->flcoeffs1, chctx->flcoeffs2);
|
||||||
|
else if (stream_format_code & 0x4)
|
||||||
imc_decode_level_coefficients(q, chctx->levlCoeffBuf,
|
imc_decode_level_coefficients(q, chctx->levlCoeffBuf,
|
||||||
chctx->flcoeffs1, chctx->flcoeffs2);
|
chctx->flcoeffs1, chctx->flcoeffs2);
|
||||||
else
|
else
|
||||||
|
@ -94,7 +94,7 @@ typedef struct Indeo3DecodeContext {
|
|||||||
|
|
||||||
int16_t width, height;
|
int16_t width, height;
|
||||||
uint32_t frame_num; ///< current frame number (zero-based)
|
uint32_t frame_num; ///< current frame number (zero-based)
|
||||||
uint32_t data_size; ///< size of the frame data in bytes
|
int data_size; ///< size of the frame data in bytes
|
||||||
uint16_t frame_flags; ///< frame properties
|
uint16_t frame_flags; ///< frame properties
|
||||||
uint8_t cb_offset; ///< needed for selecting VQ tables
|
uint8_t cb_offset; ///< needed for selecting VQ tables
|
||||||
uint8_t buf_sel; ///< active frame buffer: 0 - primary, 1 -secondary
|
uint8_t buf_sel; ///< active frame buffer: 0 - primary, 1 -secondary
|
||||||
@ -899,7 +899,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
|||||||
GetByteContext gb;
|
GetByteContext gb;
|
||||||
const uint8_t *bs_hdr;
|
const uint8_t *bs_hdr;
|
||||||
uint32_t frame_num, word2, check_sum, data_size;
|
uint32_t frame_num, word2, check_sum, data_size;
|
||||||
uint32_t y_offset, u_offset, v_offset, starts[3], ends[3];
|
int y_offset, u_offset, v_offset;
|
||||||
|
uint32_t starts[3], ends[3];
|
||||||
uint16_t height, width;
|
uint16_t height, width;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -981,7 +982,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
|||||||
ctx->y_data_size = ends[0] - starts[0];
|
ctx->y_data_size = ends[0] - starts[0];
|
||||||
ctx->v_data_size = ends[1] - starts[1];
|
ctx->v_data_size = ends[1] - starts[1];
|
||||||
ctx->u_data_size = ends[2] - starts[2];
|
ctx->u_data_size = ends[2] - starts[2];
|
||||||
if (FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
|
if (FFMIN3(y_offset, v_offset, u_offset) < 0 ||
|
||||||
|
FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
|
||||||
FFMIN3(y_offset, v_offset, u_offset) < gb.buffer - bs_hdr + 16 ||
|
FFMIN3(y_offset, v_offset, u_offset) < gb.buffer - bs_hdr + 16 ||
|
||||||
FFMIN3(ctx->y_data_size, ctx->v_data_size, ctx->u_data_size) <= 0) {
|
FFMIN3(ctx->y_data_size, ctx->v_data_size, ctx->u_data_size) <= 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n");
|
av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n");
|
||||||
|
@ -269,6 +269,11 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s,
|
|||||||
x += stride;
|
x += stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (x >= w) {
|
||||||
|
av_log(NULL, AV_LOG_ERROR, "run overflow\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* decode run termination value */
|
/* decode run termination value */
|
||||||
Rb = R(last, x);
|
Rb = R(last, x);
|
||||||
RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;
|
RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;
|
||||||
|
@ -43,6 +43,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
JvContext *s = avctx->priv_data;
|
JvContext *s = avctx->priv_data;
|
||||||
|
|
||||||
|
if (!avctx->width || !avctx->height ||
|
||||||
|
(avctx->width & 7) || (avctx->height & 7)) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Invalid video dimensions: %dx%d\n",
|
||||||
|
avctx->width, avctx->height);
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
s->frame = av_frame_alloc();
|
s->frame = av_frame_alloc();
|
||||||
if (!s->frame)
|
if (!s->frame)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
@ -96,8 +96,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->data[0],
|
WebRtcIlbcfix_DecodeImpl((int16_t *) frame->data[0], (const uint16_t *) buf, &s->decoder, 1);
|
||||||
(const WebRtc_UWord16*) buf, &s->decoder, 1);
|
|
||||||
|
|
||||||
*got_frame_ptr = 1;
|
*got_frame_ptr = 1;
|
||||||
|
|
||||||
@ -170,7 +169,7 @@ static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) < 0)
|
if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
WebRtcIlbcfix_EncodeImpl((WebRtc_UWord16*) avpkt->data, (const WebRtc_Word16*) frame->data[0], &s->encoder);
|
WebRtcIlbcfix_EncodeImpl((uint16_t *) avpkt->data, (const int16_t *) frame->data[0], &s->encoder);
|
||||||
|
|
||||||
avpkt->size = s->encoder.no_of_bytes;
|
avpkt->size = s->encoder.no_of_bytes;
|
||||||
*got_packet_ptr = 1;
|
*got_packet_ptr = 1;
|
||||||
|
@ -244,9 +244,10 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
|
|||||||
|
|
||||||
int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||||
{
|
{
|
||||||
int len, nb_components, i, width, height, pix_fmt_id, ret;
|
int len, nb_components, i, width, height, bits, ret;
|
||||||
int h_count[MAX_COMPONENTS];
|
unsigned pix_fmt_id;
|
||||||
int v_count[MAX_COMPONENTS];
|
int h_count[MAX_COMPONENTS] = { 0 };
|
||||||
|
int v_count[MAX_COMPONENTS] = { 0 };
|
||||||
|
|
||||||
s->cur_scan = 0;
|
s->cur_scan = 0;
|
||||||
s->upscale_h = s->upscale_v = 0;
|
s->upscale_h = s->upscale_v = 0;
|
||||||
@ -254,11 +255,11 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
/* XXX: verify len field validity */
|
/* XXX: verify len field validity */
|
||||||
len = get_bits(&s->gb, 16);
|
len = get_bits(&s->gb, 16);
|
||||||
s->avctx->bits_per_raw_sample =
|
s->avctx->bits_per_raw_sample =
|
||||||
s->bits = get_bits(&s->gb, 8);
|
bits = get_bits(&s->gb, 8);
|
||||||
|
|
||||||
if (s->pegasus_rct)
|
if (s->pegasus_rct)
|
||||||
s->bits = 9;
|
bits = 9;
|
||||||
if (s->bits == 9 && !s->pegasus_rct)
|
if (bits == 9 && !s->pegasus_rct)
|
||||||
s->rct = 1; // FIXME ugly
|
s->rct = 1; // FIXME ugly
|
||||||
|
|
||||||
if(s->lossless && s->avctx->lowres){
|
if(s->lossless && s->avctx->lowres){
|
||||||
@ -291,7 +292,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s->ls && !(s->bits <= 8 || nb_components == 1)) {
|
if (s->ls && !(bits <= 8 || nb_components == 1)) {
|
||||||
avpriv_report_missing_feature(s->avctx,
|
avpriv_report_missing_feature(s->avctx,
|
||||||
"JPEG-LS that is not <= 8 "
|
"JPEG-LS that is not <= 8 "
|
||||||
"bits/component or 16-bit gray");
|
"bits/component or 16-bit gray");
|
||||||
@ -300,8 +301,6 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
s->nb_components = nb_components;
|
s->nb_components = nb_components;
|
||||||
s->h_max = 1;
|
s->h_max = 1;
|
||||||
s->v_max = 1;
|
s->v_max = 1;
|
||||||
memset(h_count, 0, sizeof(h_count));
|
|
||||||
memset(v_count, 0, sizeof(v_count));
|
|
||||||
for (i = 0; i < nb_components; i++) {
|
for (i = 0; i < nb_components; i++) {
|
||||||
/* component id */
|
/* component id */
|
||||||
s->component_id[i] = get_bits(&s->gb, 8) - 1;
|
s->component_id[i] = get_bits(&s->gb, 8) - 1;
|
||||||
@ -336,12 +335,13 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
|
|
||||||
|
|
||||||
/* if different size, realloc/alloc picture */
|
/* if different size, realloc/alloc picture */
|
||||||
if ( width != s->width || height != s->height
|
if (width != s->width || height != s->height || bits != s->bits ||
|
||||||
|| memcmp(s->h_count, h_count, sizeof(h_count))
|
memcmp(s->h_count, h_count, sizeof(h_count)) ||
|
||||||
|| memcmp(s->v_count, v_count, sizeof(v_count))) {
|
memcmp(s->v_count, v_count, sizeof(v_count))) {
|
||||||
|
|
||||||
s->width = width;
|
s->width = width;
|
||||||
s->height = height;
|
s->height = height;
|
||||||
|
s->bits = bits;
|
||||||
memcpy(s->h_count, h_count, sizeof(h_count));
|
memcpy(s->h_count, h_count, sizeof(h_count));
|
||||||
memcpy(s->v_count, v_count, sizeof(v_count));
|
memcpy(s->v_count, v_count, sizeof(v_count));
|
||||||
s->interlaced = 0;
|
s->interlaced = 0;
|
||||||
@ -376,7 +376,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
else if (!s->lossless)
|
else if (!s->lossless)
|
||||||
s->rgb = 0;
|
s->rgb = 0;
|
||||||
/* XXX: not complete test ! */
|
/* XXX: not complete test ! */
|
||||||
pix_fmt_id = (s->h_count[0] << 28) | (s->v_count[0] << 24) |
|
pix_fmt_id = ((unsigned)s->h_count[0] << 28) | (s->v_count[0] << 24) |
|
||||||
(s->h_count[1] << 20) | (s->v_count[1] << 16) |
|
(s->h_count[1] << 20) | (s->v_count[1] << 16) |
|
||||||
(s->h_count[2] << 12) | (s->v_count[2] << 8) |
|
(s->h_count[2] << 12) | (s->v_count[2] << 8) |
|
||||||
(s->h_count[3] << 4) | s->v_count[3];
|
(s->h_count[3] << 4) | s->v_count[3];
|
||||||
@ -512,6 +512,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
else s->avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
|
else s->avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
|
||||||
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||||
if (pix_fmt_id == 0x42111100) {
|
if (pix_fmt_id == 0x42111100) {
|
||||||
|
if (s->bits > 8)
|
||||||
|
goto unk_pixfmt;
|
||||||
s->upscale_h = 6;
|
s->upscale_h = 6;
|
||||||
s->chroma_height = (s->height + 1) / 2;
|
s->chroma_height = (s->height + 1) / 2;
|
||||||
}
|
}
|
||||||
@ -1592,6 +1594,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (id == AV_RB32("LJIF")) {
|
if (id == AV_RB32("LJIF")) {
|
||||||
|
int rgb = s->rgb;
|
||||||
|
int pegasus_rct = s->pegasus_rct;
|
||||||
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
|
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
|
||||||
av_log(s->avctx, AV_LOG_INFO,
|
av_log(s->avctx, AV_LOG_INFO,
|
||||||
"Pegasus lossless jpeg header found\n");
|
"Pegasus lossless jpeg header found\n");
|
||||||
@ -1601,17 +1605,27 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
|
|||||||
skip_bits(&s->gb, 16); /* unknown always 0? */
|
skip_bits(&s->gb, 16); /* unknown always 0? */
|
||||||
switch (i=get_bits(&s->gb, 8)) {
|
switch (i=get_bits(&s->gb, 8)) {
|
||||||
case 1:
|
case 1:
|
||||||
s->rgb = 1;
|
rgb = 1;
|
||||||
s->pegasus_rct = 0;
|
pegasus_rct = 0;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
s->rgb = 1;
|
rgb = 1;
|
||||||
s->pegasus_rct = 1;
|
pegasus_rct = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace %d\n", i);
|
av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace %d\n", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
len -= 9;
|
len -= 9;
|
||||||
|
if (s->got_picture)
|
||||||
|
if (rgb != s->rgb || pegasus_rct != s->pegasus_rct) {
|
||||||
|
av_log(s->avctx, AV_LOG_WARNING, "Mismatching LJIF tag\n");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
s->rgb = rgb;
|
||||||
|
s->pegasus_rct = pegasus_rct;
|
||||||
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (id == AV_RL32("colr") && len > 0) {
|
if (id == AV_RL32("colr") && len > 0) {
|
||||||
|
@ -241,7 +241,7 @@ AVCodec ff_amv_encoder = {
|
|||||||
.encode2 = amv_encode_picture,
|
.encode2 = amv_encode_picture,
|
||||||
.close = ff_mpv_encode_end,
|
.close = ff_mpv_encode_end,
|
||||||
.pix_fmts = (const enum AVPixelFormat[]){
|
.pix_fmts = (const enum AVPixelFormat[]){
|
||||||
AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_NONE
|
AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,6 +61,13 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||||
|
|
||||||
|
if (!avctx->width || !avctx->height ||
|
||||||
|
(avctx->width & 1) || (avctx->height & 1)) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Invalid video dimensions: %dx%d\n",
|
||||||
|
avctx->width, avctx->height);
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
s->frame = av_frame_alloc();
|
s->frame = av_frame_alloc();
|
||||||
if (!s->frame)
|
if (!s->frame)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
@ -109,7 +116,7 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
|
|||||||
|
|
||||||
if (color) {
|
if (color) {
|
||||||
memset(s->frame->data[0] + y*s->frame->linesize[0] + x, color, run_length);
|
memset(s->frame->data[0] + y*s->frame->linesize[0] + x, color, run_length);
|
||||||
if (half_vert)
|
if (half_vert && y + half_vert < s->avctx->height)
|
||||||
memset(s->frame->data[0] + (y+1)*s->frame->linesize[0] + x, color, run_length);
|
memset(s->frame->data[0] + (y+1)*s->frame->linesize[0] + x, color, run_length);
|
||||||
}
|
}
|
||||||
x+= run_length;
|
x+= run_length;
|
||||||
|
@ -193,7 +193,13 @@ static av_always_inline int cmp_inline(MpegEncContext *s, const int x, const int
|
|||||||
int uvdxy; /* no, it might not be used uninitialized */
|
int uvdxy; /* no, it might not be used uninitialized */
|
||||||
if(dxy){
|
if(dxy){
|
||||||
if(qpel){
|
if(qpel){
|
||||||
c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); //FIXME prototype (add h)
|
if (h << size == 16) {
|
||||||
|
c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); //FIXME prototype (add h)
|
||||||
|
} else if (size == 0 && h == 8) {
|
||||||
|
c->qpel_put[1][dxy](c->temp , ref[0] + x + y*stride , stride);
|
||||||
|
c->qpel_put[1][dxy](c->temp + 8, ref[0] + x + y*stride + 8, stride);
|
||||||
|
} else
|
||||||
|
av_assert2(0);
|
||||||
if(chroma){
|
if(chroma){
|
||||||
int cx= hx/2;
|
int cx= hx/2;
|
||||||
int cy= hy/2;
|
int cy= hy/2;
|
||||||
|
@ -1120,6 +1120,10 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx)
|
|||||||
MpegEncContext *s2 = &s->mpeg_enc_ctx;
|
MpegEncContext *s2 = &s->mpeg_enc_ctx;
|
||||||
|
|
||||||
ff_mpv_decode_defaults(s2);
|
ff_mpv_decode_defaults(s2);
|
||||||
|
|
||||||
|
if ( avctx->codec_tag != AV_RL32("VCR2")
|
||||||
|
&& avctx->codec_tag != AV_RL32("BW10"))
|
||||||
|
avctx->coded_width = avctx->coded_height = 0; // do not trust dimensions from input
|
||||||
ff_mpv_decode_init(s2, avctx);
|
ff_mpv_decode_init(s2, avctx);
|
||||||
|
|
||||||
s->mpeg_enc_ctx.avctx = avctx;
|
s->mpeg_enc_ctx.avctx = avctx;
|
||||||
@ -1209,6 +1213,16 @@ static const enum AVPixelFormat mpeg2_hwaccel_pixfmt_list_420[] = {
|
|||||||
AV_PIX_FMT_NONE
|
AV_PIX_FMT_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const enum AVPixelFormat mpeg12_pixfmt_list_422[] = {
|
||||||
|
AV_PIX_FMT_YUV422P,
|
||||||
|
AV_PIX_FMT_NONE
|
||||||
|
};
|
||||||
|
|
||||||
|
static const enum AVPixelFormat mpeg12_pixfmt_list_444[] = {
|
||||||
|
AV_PIX_FMT_YUV444P,
|
||||||
|
AV_PIX_FMT_NONE
|
||||||
|
};
|
||||||
|
|
||||||
static inline int uses_vdpau(AVCodecContext *avctx) {
|
static inline int uses_vdpau(AVCodecContext *avctx) {
|
||||||
return avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG1 || avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG2;
|
return avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG1 || avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG2;
|
||||||
}
|
}
|
||||||
@ -1217,16 +1231,18 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
Mpeg1Context *s1 = avctx->priv_data;
|
Mpeg1Context *s1 = avctx->priv_data;
|
||||||
MpegEncContext *s = &s1->mpeg_enc_ctx;
|
MpegEncContext *s = &s1->mpeg_enc_ctx;
|
||||||
|
const enum AVPixelFormat *pix_fmts;
|
||||||
|
|
||||||
if (s->chroma_format < 2)
|
if (s->chroma_format < 2)
|
||||||
return ff_thread_get_format(avctx,
|
pix_fmts = avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO ?
|
||||||
avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO ?
|
|
||||||
mpeg1_hwaccel_pixfmt_list_420 :
|
mpeg1_hwaccel_pixfmt_list_420 :
|
||||||
mpeg2_hwaccel_pixfmt_list_420);
|
mpeg2_hwaccel_pixfmt_list_420;
|
||||||
else if (s->chroma_format == 2)
|
else if (s->chroma_format == 2)
|
||||||
return AV_PIX_FMT_YUV422P;
|
pix_fmts = mpeg12_pixfmt_list_422;
|
||||||
else
|
else
|
||||||
return AV_PIX_FMT_YUV444P;
|
pix_fmts = mpeg12_pixfmt_list_444;
|
||||||
|
|
||||||
|
return ff_thread_get_format(avctx, pix_fmts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)
|
static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)
|
||||||
|
@ -88,7 +88,7 @@ static int mpeg4_decode_header(AVCodecParserContext *s1, AVCodecContext *avctx,
|
|||||||
if (avctx->extradata_size && pc->first_picture) {
|
if (avctx->extradata_size && pc->first_picture) {
|
||||||
init_get_bits(gb, avctx->extradata, avctx->extradata_size * 8);
|
init_get_bits(gb, avctx->extradata, avctx->extradata_size * 8);
|
||||||
ret = ff_mpeg4_decode_picture_header(dec_ctx, gb);
|
ret = ff_mpeg4_decode_picture_header(dec_ctx, gb);
|
||||||
if (ret < 0)
|
if (ret < -1)
|
||||||
av_log(avctx, AV_LOG_WARNING, "Failed to parse extradata\n");
|
av_log(avctx, AV_LOG_WARNING, "Failed to parse extradata\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2793,7 +2793,7 @@ AVCodec ff_mpeg4_vdpau_decoder = {
|
|||||||
.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"),
|
.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"),
|
||||||
.type = AVMEDIA_TYPE_VIDEO,
|
.type = AVMEDIA_TYPE_VIDEO,
|
||||||
.id = AV_CODEC_ID_MPEG4,
|
.id = AV_CODEC_ID_MPEG4,
|
||||||
.priv_data_size = sizeof(MpegEncContext),
|
.priv_data_size = sizeof(Mpeg4DecContext),
|
||||||
.init = decode_init,
|
.init = decode_init,
|
||||||
.close = ff_h263_decode_end,
|
.close = ff_h263_decode_end,
|
||||||
.decode = ff_h263_decode_frame,
|
.decode = ff_h263_decode_frame,
|
||||||
|
@ -73,20 +73,21 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
|
|||||||
if (i > 4)
|
if (i > 4)
|
||||||
s->header_count = -2;
|
s->header_count = -2;
|
||||||
} else {
|
} else {
|
||||||
|
int header_threshold = avctx->codec_id != AV_CODEC_ID_NONE && avctx->codec_id != codec_id;
|
||||||
if((state&SAME_HEADER_MASK) != (s->header&SAME_HEADER_MASK) && s->header)
|
if((state&SAME_HEADER_MASK) != (s->header&SAME_HEADER_MASK) && s->header)
|
||||||
s->header_count= -3;
|
s->header_count= -3;
|
||||||
s->header= state;
|
s->header= state;
|
||||||
s->header_count++;
|
s->header_count++;
|
||||||
s->frame_size = ret-4;
|
s->frame_size = ret-4;
|
||||||
|
|
||||||
if (s->header_count > 0 + (avctx->codec_id != AV_CODEC_ID_NONE && avctx->codec_id != codec_id)) {
|
if (s->header_count > header_threshold) {
|
||||||
avctx->sample_rate= sr;
|
avctx->sample_rate= sr;
|
||||||
avctx->channels = channels;
|
avctx->channels = channels;
|
||||||
s1->duration = frame_size;
|
s1->duration = frame_size;
|
||||||
avctx->codec_id = codec_id;
|
avctx->codec_id = codec_id;
|
||||||
if (s->no_bitrate || !avctx->bit_rate) {
|
if (s->no_bitrate || !avctx->bit_rate) {
|
||||||
s->no_bitrate = 1;
|
s->no_bitrate = 1;
|
||||||
avctx->bit_rate += (bit_rate - avctx->bit_rate) / s->header_count;
|
avctx->bit_rate += (bit_rate - avctx->bit_rate) / (s->header_count - header_threshold);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -908,6 +908,11 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx)
|
|||||||
On2AVCContext *c = avctx->priv_data;
|
On2AVCContext *c = avctx->priv_data;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (avctx->channels > 2U) {
|
||||||
|
avpriv_request_sample(avctx, "Decoding more than 2 channels");
|
||||||
|
return AVERROR_PATCHWELCOME;
|
||||||
|
}
|
||||||
|
|
||||||
c->avctx = avctx;
|
c->avctx = avctx;
|
||||||
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
|
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
|
||||||
avctx->channel_layout = (avctx->channels == 2) ? AV_CH_LAYOUT_STEREO
|
avctx->channel_layout = (avctx->channels == 2) ? AV_CH_LAYOUT_STEREO
|
||||||
@ -918,6 +923,7 @@ static av_cold int on2avc_decode_init(AVCodecContext *avctx)
|
|||||||
av_log(avctx, AV_LOG_ERROR, "0x500 version should be mono\n");
|
av_log(avctx, AV_LOG_ERROR, "0x500 version should be mono\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->channels == 2)
|
if (avctx->channels == 2)
|
||||||
av_log(avctx, AV_LOG_WARNING,
|
av_log(avctx, AV_LOG_WARNING,
|
||||||
"Stereo mode support is not good, patch is welcome\n");
|
"Stereo mode support is not good, patch is welcome\n");
|
||||||
|
@ -105,8 +105,8 @@ static const AVOption avcodec_options[] = {
|
|||||||
{"extradata_size", NULL, OFFSET(extradata_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
{"extradata_size", NULL, OFFSET(extradata_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
||||||
{"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, INT_MIN, INT_MAX},
|
{"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, INT_MIN, INT_MAX},
|
||||||
{"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
|
{"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E},
|
||||||
{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|D|E},
|
{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
|
||||||
{"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|D|E},
|
{"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E},
|
||||||
{"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
|
{"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
|
||||||
{"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
|
{"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
|
||||||
{"frame_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
{"frame_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
|
||||||
|
@ -499,6 +499,12 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
|
|||||||
av_log(avctx, AV_LOG_ERROR, "Error parsing the packet header.\n");
|
av_log(avctx, AV_LOG_ERROR, "Error parsing the packet header.\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
if (coded_samples != s->packet.frame_count * s->packet.frame_duration) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
|
"Mismatching coded sample count in substream %d.\n", i);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
s->silk_samplerate = get_silk_samplerate(s->packet.config);
|
s->silk_samplerate = get_silk_samplerate(s->packet.config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,6 +582,12 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
case MKTAG('I', 'H', 'D', 'R'):
|
case MKTAG('I', 'H', 'D', 'R'):
|
||||||
if (length != 13)
|
if (length != 13)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
if (s->state & PNG_IDAT) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "IHDR after IDAT\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
s->width = bytestream2_get_be32(&s->gb);
|
s->width = bytestream2_get_be32(&s->gb);
|
||||||
s->height = bytestream2_get_be32(&s->gb);
|
s->height = bytestream2_get_be32(&s->gb);
|
||||||
if (av_image_check_size(s->width, s->height, 0, avctx)) {
|
if (av_image_check_size(s->width, s->height, 0, avctx)) {
|
||||||
@ -650,7 +656,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
} else if ((s->bits_per_pixel == 1 || s->bits_per_pixel == 2 || s->bits_per_pixel == 4 || s->bits_per_pixel == 8) &&
|
} else if ((s->bits_per_pixel == 1 || s->bits_per_pixel == 2 || s->bits_per_pixel == 4 || s->bits_per_pixel == 8) &&
|
||||||
s->color_type == PNG_COLOR_TYPE_PALETTE) {
|
s->color_type == PNG_COLOR_TYPE_PALETTE) {
|
||||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||||
} else if (s->bit_depth == 1) {
|
} else if (s->bit_depth == 1 && s->bits_per_pixel == 1) {
|
||||||
avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
|
avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
|
||||||
} else if (s->bit_depth == 8 &&
|
} else if (s->bit_depth == 8 &&
|
||||||
s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
|
s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
|
||||||
@ -860,10 +866,11 @@ exit_loop:
|
|||||||
int i, j;
|
int i, j;
|
||||||
uint8_t *pd = p->data[0];
|
uint8_t *pd = p->data[0];
|
||||||
uint8_t *pd_last = s->last_picture.f->data[0];
|
uint8_t *pd_last = s->last_picture.f->data[0];
|
||||||
|
int ls = FFMIN(av_image_get_linesize(p->format, s->width, 0), s->width * s->bpp);
|
||||||
|
|
||||||
ff_thread_await_progress(&s->last_picture, INT_MAX, 0);
|
ff_thread_await_progress(&s->last_picture, INT_MAX, 0);
|
||||||
for (j = 0; j < s->height; j++) {
|
for (j = 0; j < s->height; j++) {
|
||||||
for (i = 0; i < s->width * s->bpp; i++)
|
for (i = 0; i < ls; i++)
|
||||||
pd[i] += pd_last[i];
|
pd[i] += pd_last[i];
|
||||||
pd += s->image_linesize;
|
pd += s->image_linesize;
|
||||||
pd_last += s->image_linesize;
|
pd_last += s->image_linesize;
|
||||||
|
@ -163,7 +163,7 @@ static void av_noinline qpeg_decode_inter(QpegContext *qctx, uint8_t *dst,
|
|||||||
|
|
||||||
/* check motion vector */
|
/* check motion vector */
|
||||||
if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
|
if ((me_x + filled < 0) || (me_x + me_w + filled > width) ||
|
||||||
(height - me_y - me_h < 0) || (height - me_y > orig_height) ||
|
(height - me_y - me_h < 0) || (height - me_y >= orig_height) ||
|
||||||
(filled + me_w > width) || (height - me_h < 0))
|
(filled + me_w > width) || (height - me_h < 0))
|
||||||
av_log(NULL, AV_LOG_ERROR, "Bogus motion vector (%i,%i), block size %ix%i at %i,%i\n",
|
av_log(NULL, AV_LOG_ERROR, "Bogus motion vector (%i,%i), block size %ix%i at %i,%i\n",
|
||||||
me_x, me_y, me_w, me_h, filled, height);
|
me_x, me_y, me_w, me_h, filled, height);
|
||||||
|
@ -172,6 +172,9 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
context->frame_size = avpicture_get_size(avctx->pix_fmt, avctx->width,
|
context->frame_size = avpicture_get_size(avctx->pix_fmt, avctx->width,
|
||||||
avctx->height);
|
avctx->height);
|
||||||
}
|
}
|
||||||
|
if (context->frame_size < 0)
|
||||||
|
return context->frame_size;
|
||||||
|
|
||||||
need_copy = !avpkt->buf || context->is_2_4_bpp || context->is_yuv2 || context->is_lt_16bpp;
|
need_copy = !avpkt->buf || context->is_2_4_bpp || context->is_yuv2 || context->is_lt_16bpp;
|
||||||
|
|
||||||
frame->pict_type = AV_PICTURE_TYPE_I;
|
frame->pict_type = AV_PICTURE_TYPE_I;
|
||||||
|
@ -98,7 +98,7 @@ static int expand_rle_row16(SgiState *s, uint16_t *out_buf,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
/* Check for buffer overflow. */
|
/* Check for buffer overflow. */
|
||||||
if (pixelstride * (count - 1) >= len) {
|
if (out_end - out_buf <= pixelstride * (count - 1)) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Invalid pixel count.\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
|
|||||||
for (z = 0; z < s->depth; z++) {
|
for (z = 0; z < s->depth; z++) {
|
||||||
dest_row = out_buf;
|
dest_row = out_buf;
|
||||||
for (y = 0; y < s->height; y++) {
|
for (y = 0; y < s->height; y++) {
|
||||||
linesize = s->width * s->depth * s->bytes_per_channel;
|
linesize = s->width * s->depth;
|
||||||
dest_row -= s->linesize;
|
dest_row -= s->linesize;
|
||||||
start_offset = bytestream2_get_be32(&g_table);
|
start_offset = bytestream2_get_be32(&g_table);
|
||||||
bytestream2_seek(&s->g, start_offset, SEEK_SET);
|
bytestream2_seek(&s->g, start_offset, SEEK_SET);
|
||||||
|
@ -70,7 +70,7 @@ typedef struct SmcContext {
|
|||||||
row_ptr += stride * 4; \
|
row_ptr += stride * 4; \
|
||||||
} \
|
} \
|
||||||
total_blocks--; \
|
total_blocks--; \
|
||||||
if (total_blocks < 0) \
|
if (total_blocks < !!n_blocks) \
|
||||||
{ \
|
{ \
|
||||||
av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
|
av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
|
||||||
return; \
|
return; \
|
||||||
|
@ -499,7 +499,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, HpelDSPContext *hdsp,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out)
|
static void svq1_parse_string(GetBitContext *bitbuf, uint8_t out[257])
|
||||||
{
|
{
|
||||||
uint8_t seed;
|
uint8_t seed;
|
||||||
int i;
|
int i;
|
||||||
@ -511,6 +511,7 @@ static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out)
|
|||||||
out[i] = get_bits(bitbuf, 8) ^ seed;
|
out[i] = get_bits(bitbuf, 8) ^ seed;
|
||||||
seed = string_table[out[i] ^ seed];
|
seed = string_table[out[i] ^ seed];
|
||||||
}
|
}
|
||||||
|
out[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
|
static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
|
||||||
@ -553,12 +554,12 @@ static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((s->frame_code ^ 0x10) >= 0x50) {
|
if ((s->frame_code ^ 0x10) >= 0x50) {
|
||||||
uint8_t msg[256];
|
uint8_t msg[257];
|
||||||
|
|
||||||
svq1_parse_string(bitbuf, msg);
|
svq1_parse_string(bitbuf, msg);
|
||||||
|
|
||||||
av_log(avctx, AV_LOG_INFO,
|
av_log(avctx, AV_LOG_INFO,
|
||||||
"embedded message:\n%s\n", (char *)msg);
|
"embedded message:\n%s\n", ((char *)msg) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
skip_bits(bitbuf, 2);
|
skip_bits(bitbuf, 2);
|
||||||
|
@ -1176,7 +1176,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
|
|
||||||
h->cur_pic_ptr = s->cur_pic;
|
h->cur_pic_ptr = s->cur_pic;
|
||||||
av_frame_unref(&h->cur_pic.f);
|
av_frame_unref(&h->cur_pic.f);
|
||||||
h->cur_pic = *s->cur_pic;
|
memcpy(&h->cur_pic.tf, &s->cur_pic->tf, sizeof(h->cur_pic) - offsetof(H264Picture, tf));
|
||||||
ret = av_frame_ref(&h->cur_pic.f, &s->cur_pic->f);
|
ret = av_frame_ref(&h->cur_pic.f, &s->cur_pic->f);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -812,13 +812,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
|
|||||||
s->height = value;
|
s->height = value;
|
||||||
break;
|
break;
|
||||||
case TIFF_BPP:
|
case TIFF_BPP:
|
||||||
s->bppcount = count;
|
if (count > 4U) {
|
||||||
if (count > 4) {
|
|
||||||
av_log(s->avctx, AV_LOG_ERROR,
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
"This format is not supported (bpp=%d, %d components)\n",
|
"This format is not supported (bpp=%d, %d components)\n",
|
||||||
s->bpp, count);
|
value, count);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
s->bppcount = count;
|
||||||
if (count == 1)
|
if (count == 1)
|
||||||
s->bpp = value;
|
s->bpp = value;
|
||||||
else {
|
else {
|
||||||
@ -836,6 +836,13 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
|
|||||||
s->bpp = -1;
|
s->bpp = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (s->bpp > 64U) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
|
"This format is not supported (bpp=%d, %d components)\n",
|
||||||
|
s->bpp, count);
|
||||||
|
s->bpp = 0;
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TIFF_SAMPLES_PER_PIXEL:
|
case TIFF_SAMPLES_PER_PIXEL:
|
||||||
if (count != 1) {
|
if (count != 1) {
|
||||||
|
@ -305,7 +305,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
|
|
||||||
strips = (s->height - 1) / s->rps + 1;
|
strips = (s->height - 1) / s->rps + 1;
|
||||||
|
|
||||||
packet_size = avctx->height * ((avctx->width * s->bpp + 7) >> 3) * 2 +
|
bytes_per_row = (((s->width - 1) / s->subsampling[0] + 1) * s->bpp *
|
||||||
|
s->subsampling[0] * s->subsampling[1] + 7) >> 3;
|
||||||
|
packet_size = avctx->height * bytes_per_row * 2 +
|
||||||
avctx->height * 4 + FF_MIN_BUFFER_SIZE;
|
avctx->height * 4 + FF_MIN_BUFFER_SIZE;
|
||||||
|
|
||||||
if ((ret = ff_alloc_packet2(avctx, pkt, packet_size)) < 0)
|
if ((ret = ff_alloc_packet2(avctx, pkt, packet_size)) < 0)
|
||||||
@ -333,8 +335,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes_per_row = (((s->width - 1) / s->subsampling[0] + 1) * s->bpp *
|
|
||||||
s->subsampling[0] * s->subsampling[1] + 7) >> 3;
|
|
||||||
if (is_yuv) {
|
if (is_yuv) {
|
||||||
av_fast_padded_malloc(&s->yuv_line, &s->yuv_line_size, bytes_per_row);
|
av_fast_padded_malloc(&s->yuv_line, &s->yuv_line_size, bytes_per_row);
|
||||||
if (s->yuv_line == NULL) {
|
if (s->yuv_line == NULL) {
|
||||||
|
@ -66,6 +66,9 @@
|
|||||||
#include "compat/os2threads.h"
|
#include "compat/os2threads.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "libavutil/ffversion.h"
|
||||||
|
const char av_codec_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||||
|
|
||||||
#if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS
|
#if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS
|
||||||
static int default_lockmgr_cb(void **arg, enum AVLockOp op)
|
static int default_lockmgr_cb(void **arg, enum AVLockOp op)
|
||||||
{
|
{
|
||||||
@ -279,6 +282,12 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
|||||||
int i;
|
int i;
|
||||||
int w_align = 1;
|
int w_align = 1;
|
||||||
int h_align = 1;
|
int h_align = 1;
|
||||||
|
AVPixFmtDescriptor const *desc = av_pix_fmt_desc_get(s->pix_fmt);
|
||||||
|
|
||||||
|
if (desc) {
|
||||||
|
w_align = 1 << desc->log2_chroma_w;
|
||||||
|
h_align = 1 << desc->log2_chroma_h;
|
||||||
|
}
|
||||||
|
|
||||||
switch (s->pix_fmt) {
|
switch (s->pix_fmt) {
|
||||||
case AV_PIX_FMT_YUV420P:
|
case AV_PIX_FMT_YUV420P:
|
||||||
@ -387,6 +396,10 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
|||||||
w_align = 4;
|
w_align = 4;
|
||||||
h_align = 4;
|
h_align = 4;
|
||||||
}
|
}
|
||||||
|
if (s->codec_id == AV_CODEC_ID_JV) {
|
||||||
|
w_align = 8;
|
||||||
|
h_align = 8;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case AV_PIX_FMT_BGR24:
|
case AV_PIX_FMT_BGR24:
|
||||||
if ((s->codec_id == AV_CODEC_ID_MSZH) ||
|
if ((s->codec_id == AV_CODEC_ID_MSZH) ||
|
||||||
@ -402,8 +415,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
w_align = 1;
|
|
||||||
h_align = 1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3602,6 +3613,11 @@ int avpriv_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf)
|
|||||||
ret = av_bprint_finalize(buf, &str);
|
ret = av_bprint_finalize(buf, &str);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
if (!av_bprint_is_complete(buf)) {
|
||||||
|
av_free(str);
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
|
|
||||||
avctx->extradata = str;
|
avctx->extradata = str;
|
||||||
/* Note: the string is NUL terminated (so extradata can be read as a
|
/* Note: the string is NUL terminated (so extradata can be read as a
|
||||||
* string), but the ending character is not accounted in the size (in
|
* string), but the ending character is not accounted in the size (in
|
||||||
|
@ -214,6 +214,8 @@ static void restore_median(uint8_t *src, int step, int stride,
|
|||||||
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
||||||
slice_start;
|
slice_start;
|
||||||
|
|
||||||
|
if (!slice_height)
|
||||||
|
continue;
|
||||||
bsrc = src + slice_start * stride;
|
bsrc = src + slice_start * stride;
|
||||||
|
|
||||||
// first line - left neighbour prediction
|
// first line - left neighbour prediction
|
||||||
@ -224,7 +226,7 @@ static void restore_median(uint8_t *src, int step, int stride,
|
|||||||
A = bsrc[i];
|
A = bsrc[i];
|
||||||
}
|
}
|
||||||
bsrc += stride;
|
bsrc += stride;
|
||||||
if (slice_height == 1)
|
if (slice_height <= 1)
|
||||||
continue;
|
continue;
|
||||||
// second line - first element has top prediction, the rest uses median
|
// second line - first element has top prediction, the rest uses median
|
||||||
C = bsrc[-stride];
|
C = bsrc[-stride];
|
||||||
@ -269,6 +271,8 @@ static void restore_median_il(uint8_t *src, int step, int stride,
|
|||||||
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
||||||
slice_start;
|
slice_start;
|
||||||
slice_height >>= 1;
|
slice_height >>= 1;
|
||||||
|
if (!slice_height)
|
||||||
|
continue;
|
||||||
|
|
||||||
bsrc = src + slice_start * stride;
|
bsrc = src + slice_start * stride;
|
||||||
|
|
||||||
@ -284,7 +288,7 @@ static void restore_median_il(uint8_t *src, int step, int stride,
|
|||||||
A = bsrc[stride + i];
|
A = bsrc[stride + i];
|
||||||
}
|
}
|
||||||
bsrc += stride2;
|
bsrc += stride2;
|
||||||
if (slice_height == 1)
|
if (slice_height <= 1)
|
||||||
continue;
|
continue;
|
||||||
// second line - first element has top prediction, the rest uses median
|
// second line - first element has top prediction, the rest uses median
|
||||||
C = bsrc[-stride2];
|
C = bsrc[-stride2];
|
||||||
|
@ -389,7 +389,7 @@ static int write_huff_codes(uint8_t *src, uint8_t *dst, int dst_size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int encode_plane(AVCodecContext *avctx, uint8_t *src,
|
static int encode_plane(AVCodecContext *avctx, uint8_t *src,
|
||||||
uint8_t *dst, int stride,
|
uint8_t *dst, int stride, int plane_no,
|
||||||
int width, int height, PutByteContext *pb)
|
int width, int height, PutByteContext *pb)
|
||||||
{
|
{
|
||||||
UtvideoContext *c = avctx->priv_data;
|
UtvideoContext *c = avctx->priv_data;
|
||||||
@ -399,6 +399,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src,
|
|||||||
HuffEntry he[256];
|
HuffEntry he[256];
|
||||||
|
|
||||||
uint32_t offset = 0, slice_len = 0;
|
uint32_t offset = 0, slice_len = 0;
|
||||||
|
const int cmask = ~(!plane_no && avctx->pix_fmt == AV_PIX_FMT_YUV420P);
|
||||||
int i, sstart, send = 0;
|
int i, sstart, send = 0;
|
||||||
int symbol;
|
int symbol;
|
||||||
int ret;
|
int ret;
|
||||||
@ -408,7 +409,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src,
|
|||||||
case PRED_NONE:
|
case PRED_NONE:
|
||||||
for (i = 0; i < c->slices; i++) {
|
for (i = 0; i < c->slices; i++) {
|
||||||
sstart = send;
|
sstart = send;
|
||||||
send = height * (i + 1) / c->slices;
|
send = height * (i + 1) / c->slices & cmask;
|
||||||
av_image_copy_plane(dst + sstart * width, width,
|
av_image_copy_plane(dst + sstart * width, width,
|
||||||
src + sstart * stride, stride,
|
src + sstart * stride, stride,
|
||||||
width, send - sstart);
|
width, send - sstart);
|
||||||
@ -417,7 +418,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src,
|
|||||||
case PRED_LEFT:
|
case PRED_LEFT:
|
||||||
for (i = 0; i < c->slices; i++) {
|
for (i = 0; i < c->slices; i++) {
|
||||||
sstart = send;
|
sstart = send;
|
||||||
send = height * (i + 1) / c->slices;
|
send = height * (i + 1) / c->slices & cmask;
|
||||||
left_predict(src + sstart * stride, dst + sstart * width,
|
left_predict(src + sstart * stride, dst + sstart * width,
|
||||||
stride, width, send - sstart);
|
stride, width, send - sstart);
|
||||||
}
|
}
|
||||||
@ -425,7 +426,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src,
|
|||||||
case PRED_MEDIAN:
|
case PRED_MEDIAN:
|
||||||
for (i = 0; i < c->slices; i++) {
|
for (i = 0; i < c->slices; i++) {
|
||||||
sstart = send;
|
sstart = send;
|
||||||
send = height * (i + 1) / c->slices;
|
send = height * (i + 1) / c->slices & cmask;
|
||||||
median_predict(c, src + sstart * stride, dst + sstart * width,
|
median_predict(c, src + sstart * stride, dst + sstart * width,
|
||||||
stride, width, send - sstart);
|
stride, width, send - sstart);
|
||||||
}
|
}
|
||||||
@ -489,7 +490,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src,
|
|||||||
send = 0;
|
send = 0;
|
||||||
for (i = 0; i < c->slices; i++) {
|
for (i = 0; i < c->slices; i++) {
|
||||||
sstart = send;
|
sstart = send;
|
||||||
send = height * (i + 1) / c->slices;
|
send = height * (i + 1) / c->slices & cmask;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write the huffman codes to a buffer,
|
* Write the huffman codes to a buffer,
|
||||||
@ -571,7 +572,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
case AV_PIX_FMT_RGBA:
|
case AV_PIX_FMT_RGBA:
|
||||||
for (i = 0; i < c->planes; i++) {
|
for (i = 0; i < c->planes; i++) {
|
||||||
ret = encode_plane(avctx, c->slice_buffer[i] + 2 * c->slice_stride,
|
ret = encode_plane(avctx, c->slice_buffer[i] + 2 * c->slice_stride,
|
||||||
c->slice_buffer[i], c->slice_stride,
|
c->slice_buffer[i], c->slice_stride, i,
|
||||||
width, height, &pb);
|
width, height, &pb);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@ -583,7 +584,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
case AV_PIX_FMT_YUV422P:
|
case AV_PIX_FMT_YUV422P:
|
||||||
for (i = 0; i < c->planes; i++) {
|
for (i = 0; i < c->planes; i++) {
|
||||||
ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],
|
ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],
|
||||||
pic->linesize[i], width >> !!i, height, &pb);
|
pic->linesize[i], i, width >> !!i, height, &pb);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Error encoding plane %d.\n", i);
|
av_log(avctx, AV_LOG_ERROR, "Error encoding plane %d.\n", i);
|
||||||
@ -594,7 +595,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
case AV_PIX_FMT_YUV420P:
|
case AV_PIX_FMT_YUV420P:
|
||||||
for (i = 0; i < c->planes; i++) {
|
for (i = 0; i < c->planes; i++) {
|
||||||
ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],
|
ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],
|
||||||
pic->linesize[i], width >> !!i, height >> !!i,
|
pic->linesize[i], i, width >> !!i, height >> !!i,
|
||||||
&pb);
|
&pb);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@ -339,6 +339,9 @@ static int vmd_decode(VmdVideoContext *s, AVFrame *frame)
|
|||||||
ofs += slen;
|
ofs += slen;
|
||||||
bytestream2_skip(&gb, len);
|
bytestream2_skip(&gb, len);
|
||||||
} else {
|
} else {
|
||||||
|
if (ofs + len > frame_width ||
|
||||||
|
bytestream2_get_bytes_left(&gb) < len)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
bytestream2_get_buffer(&gb, &dp[ofs], len);
|
bytestream2_get_buffer(&gb, &dp[ofs], len);
|
||||||
ofs += len;
|
ofs += len;
|
||||||
}
|
}
|
||||||
|
@ -1314,7 +1314,9 @@ static av_always_inline int setup_classifs(vorbis_context *vc,
|
|||||||
vorbis_residue *vr,
|
vorbis_residue *vr,
|
||||||
uint8_t *do_not_decode,
|
uint8_t *do_not_decode,
|
||||||
unsigned ch_used,
|
unsigned ch_used,
|
||||||
int partition_count)
|
int partition_count,
|
||||||
|
int ptns_to_read
|
||||||
|
)
|
||||||
{
|
{
|
||||||
int p, j, i;
|
int p, j, i;
|
||||||
unsigned c_p_c = vc->codebooks[vr->classbook].dimensions;
|
unsigned c_p_c = vc->codebooks[vr->classbook].dimensions;
|
||||||
@ -1336,7 +1338,7 @@ static av_always_inline int setup_classifs(vorbis_context *vc,
|
|||||||
for (i = partition_count + c_p_c - 1; i >= partition_count; i--) {
|
for (i = partition_count + c_p_c - 1; i >= partition_count; i--) {
|
||||||
temp2 = (((uint64_t)temp) * inverse_class) >> 32;
|
temp2 = (((uint64_t)temp) * inverse_class) >> 32;
|
||||||
|
|
||||||
if (i < vr->ptns_to_read)
|
if (i < ptns_to_read)
|
||||||
vr->classifs[p + i] = temp - temp2 * vr->classifications;
|
vr->classifs[p + i] = temp - temp2 * vr->classifications;
|
||||||
temp = temp2;
|
temp = temp2;
|
||||||
}
|
}
|
||||||
@ -1344,13 +1346,13 @@ static av_always_inline int setup_classifs(vorbis_context *vc,
|
|||||||
for (i = partition_count + c_p_c - 1; i >= partition_count; i--) {
|
for (i = partition_count + c_p_c - 1; i >= partition_count; i--) {
|
||||||
temp2 = temp / vr->classifications;
|
temp2 = temp / vr->classifications;
|
||||||
|
|
||||||
if (i < vr->ptns_to_read)
|
if (i < ptns_to_read)
|
||||||
vr->classifs[p + i] = temp - temp2 * vr->classifications;
|
vr->classifs[p + i] = temp - temp2 * vr->classifications;
|
||||||
temp = temp2;
|
temp = temp2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p += vr->ptns_to_read;
|
p += ptns_to_read;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1404,7 +1406,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
|
|||||||
for (partition_count = 0; partition_count < ptns_to_read;) { // SPEC error
|
for (partition_count = 0; partition_count < ptns_to_read;) { // SPEC error
|
||||||
if (!pass) {
|
if (!pass) {
|
||||||
int ret;
|
int ret;
|
||||||
if ((ret = setup_classifs(vc, vr, do_not_decode, ch_used, partition_count)) < 0)
|
if ((ret = setup_classifs(vc, vr, do_not_decode, ch_used, partition_count, ptns_to_read)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
for (i = 0; (i < c_p_c) && (partition_count < ptns_to_read); ++i) {
|
for (i = 0; (i < c_p_c) && (partition_count < ptns_to_read); ++i) {
|
||||||
|
@ -77,6 +77,8 @@ static int parse(AVCodecParserContext *ctx,
|
|||||||
idx += a; \
|
idx += a; \
|
||||||
if (sz > size) { \
|
if (sz > size) { \
|
||||||
s->n_frames = 0; \
|
s->n_frames = 0; \
|
||||||
|
*out_size = 0; \
|
||||||
|
*out_data = data; \
|
||||||
av_log(avctx, AV_LOG_ERROR, \
|
av_log(avctx, AV_LOG_ERROR, \
|
||||||
"Superframe packet size too big: %u > %d\n", \
|
"Superframe packet size too big: %u > %d\n", \
|
||||||
sz, size); \
|
sz, size); \
|
||||||
|
@ -1028,7 +1028,7 @@ static int apply_color_indexing_transform(WebPContext *s)
|
|||||||
ImageContext *img;
|
ImageContext *img;
|
||||||
ImageContext *pal;
|
ImageContext *pal;
|
||||||
int i, x, y;
|
int i, x, y;
|
||||||
uint8_t *p, *pi;
|
uint8_t *p;
|
||||||
|
|
||||||
img = &s->image[IMAGE_ROLE_ARGB];
|
img = &s->image[IMAGE_ROLE_ARGB];
|
||||||
pal = &s->image[IMAGE_ROLE_COLOR_INDEXING];
|
pal = &s->image[IMAGE_ROLE_COLOR_INDEXING];
|
||||||
@ -1066,11 +1066,11 @@ static int apply_color_indexing_transform(WebPContext *s)
|
|||||||
p = GET_PIXEL(img->frame, x, y);
|
p = GET_PIXEL(img->frame, x, y);
|
||||||
i = p[2];
|
i = p[2];
|
||||||
if (i >= pal->frame->width) {
|
if (i >= pal->frame->width) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "invalid palette index %d\n", i);
|
AV_WB32(p, 0x00000000);
|
||||||
return AVERROR_INVALIDDATA;
|
} else {
|
||||||
|
const uint8_t *pi = GET_PIXEL(pal->frame, i, 0);
|
||||||
|
AV_COPY32(p, pi);
|
||||||
}
|
}
|
||||||
pi = GET_PIXEL(pal->frame, i, 0);
|
|
||||||
AV_COPY32(p, pi);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,6 +422,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
offset &= ~3;
|
offset &= ~3;
|
||||||
if (offset > s->sfb_offsets[i][band - 1])
|
if (offset > s->sfb_offsets[i][band - 1])
|
||||||
s->sfb_offsets[i][band++] = offset;
|
s->sfb_offsets[i][band++] = offset;
|
||||||
|
|
||||||
|
if (offset >= subframe_len)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
s->sfb_offsets[i][band - 1] = subframe_len;
|
s->sfb_offsets[i][band - 1] = subframe_len;
|
||||||
s->num_sfb[i] = band - 1;
|
s->num_sfb[i] = band - 1;
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
;******************************************************************************
|
;******************************************************************************
|
||||||
|
|
||||||
%if ARCH_X86_64
|
|
||||||
|
|
||||||
%include "libavutil/x86/x86util.asm"
|
%include "libavutil/x86/x86util.asm"
|
||||||
|
|
||||||
|
%if ARCH_X86_64
|
||||||
|
|
||||||
SECTION_RODATA
|
SECTION_RODATA
|
||||||
|
|
||||||
cextern pb_3
|
cextern pb_3
|
||||||
|
@ -34,7 +34,7 @@ OBJS-$(CONFIG_OPENGL_OUTDEV) += opengl_enc.o
|
|||||||
OBJS-$(CONFIG_OSS_INDEV) += oss_audio.o oss_audio_dec.o
|
OBJS-$(CONFIG_OSS_INDEV) += oss_audio.o oss_audio_dec.o
|
||||||
OBJS-$(CONFIG_OSS_OUTDEV) += oss_audio.o oss_audio_enc.o
|
OBJS-$(CONFIG_OSS_OUTDEV) += oss_audio.o oss_audio_enc.o
|
||||||
OBJS-$(CONFIG_PULSE_INDEV) += pulse_audio_dec.o \
|
OBJS-$(CONFIG_PULSE_INDEV) += pulse_audio_dec.o \
|
||||||
pulse_audio_common.o
|
pulse_audio_common.o timefilter.o
|
||||||
OBJS-$(CONFIG_PULSE_OUTDEV) += pulse_audio_enc.o \
|
OBJS-$(CONFIG_PULSE_OUTDEV) += pulse_audio_enc.o \
|
||||||
pulse_audio_common.o
|
pulse_audio_common.o
|
||||||
OBJS-$(CONFIG_QTKIT_INDEV) += qtkit.o
|
OBJS-$(CONFIG_QTKIT_INDEV) += qtkit.o
|
||||||
|
@ -23,6 +23,9 @@
|
|||||||
#include "avdevice.h"
|
#include "avdevice.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "libavutil/ffversion.h"
|
||||||
|
const char av_device_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||||
|
|
||||||
#define E AV_OPT_FLAG_ENCODING_PARAM
|
#define E AV_OPT_FLAG_ENCODING_PARAM
|
||||||
#define D AV_OPT_FLAG_DECODING_PARAM
|
#define D AV_OPT_FLAG_DECODING_PARAM
|
||||||
#define A AV_OPT_FLAG_AUDIO_PARAM
|
#define A AV_OPT_FLAG_AUDIO_PARAM
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
LIBAVDEVICE_$MAJOR {
|
LIBAVDEVICE_$MAJOR {
|
||||||
global: avdevice_*;
|
global: avdevice_*; av_*;
|
||||||
local: *;
|
local: *;
|
||||||
};
|
};
|
||||||
|
@ -873,9 +873,6 @@ static int v4l2_read_header(AVFormatContext *ctx)
|
|||||||
|
|
||||||
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
|
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
|
||||||
|
|
||||||
if ((res = v4l2_set_parameters(ctx)) < 0)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
if (s->pixel_format) {
|
if (s->pixel_format) {
|
||||||
AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format);
|
AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format);
|
||||||
|
|
||||||
@ -926,6 +923,9 @@ static int v4l2_read_header(AVFormatContext *ctx)
|
|||||||
|
|
||||||
s->frame_format = desired_format;
|
s->frame_format = desired_format;
|
||||||
|
|
||||||
|
if ((res = v4l2_set_parameters(ctx)) < 0)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
st->codec->pix_fmt = avpriv_fmt_v4l2ff(desired_format, codec_id);
|
st->codec->pix_fmt = avpriv_fmt_v4l2ff(desired_format, codec_id);
|
||||||
s->frame_size =
|
s->frame_size =
|
||||||
avpicture_get_size(st->codec->pix_fmt, s->width, s->height);
|
avpicture_get_size(st->codec->pix_fmt, s->width, s->height);
|
||||||
|
@ -496,6 +496,8 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
snprintf(name, sizeof(name), "input%d", i);
|
snprintf(name, sizeof(name), "input%d", i);
|
||||||
pad.type = AVMEDIA_TYPE_AUDIO;
|
pad.type = AVMEDIA_TYPE_AUDIO;
|
||||||
pad.name = av_strdup(name);
|
pad.name = av_strdup(name);
|
||||||
|
if (!pad.name)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
pad.filter_frame = filter_frame;
|
pad.filter_frame = filter_frame;
|
||||||
|
|
||||||
ff_insert_inpad(ctx, i, &pad);
|
ff_insert_inpad(ctx, i, &pad);
|
||||||
|
@ -214,6 +214,8 @@ static av_cold int join_init(AVFilterContext *ctx)
|
|||||||
snprintf(name, sizeof(name), "input%d", i);
|
snprintf(name, sizeof(name), "input%d", i);
|
||||||
pad.type = AVMEDIA_TYPE_AUDIO;
|
pad.type = AVMEDIA_TYPE_AUDIO;
|
||||||
pad.name = av_strdup(name);
|
pad.name = av_strdup(name);
|
||||||
|
if (!pad.name)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
pad.filter_frame = filter_frame;
|
pad.filter_frame = filter_frame;
|
||||||
|
|
||||||
pad.needs_fifo = 1;
|
pad.needs_fifo = 1;
|
||||||
|
@ -41,6 +41,7 @@ typedef struct ResampleContext {
|
|||||||
AVDictionary *options;
|
AVDictionary *options;
|
||||||
|
|
||||||
int64_t next_pts;
|
int64_t next_pts;
|
||||||
|
int64_t next_in_pts;
|
||||||
|
|
||||||
/* set by filter_frame() to signal an output frame to request_frame() */
|
/* set by filter_frame() to signal an output frame to request_frame() */
|
||||||
int got_output;
|
int got_output;
|
||||||
@ -153,6 +154,7 @@ static int config_output(AVFilterLink *outlink)
|
|||||||
|
|
||||||
outlink->time_base = (AVRational){ 1, outlink->sample_rate };
|
outlink->time_base = (AVRational){ 1, outlink->sample_rate };
|
||||||
s->next_pts = AV_NOPTS_VALUE;
|
s->next_pts = AV_NOPTS_VALUE;
|
||||||
|
s->next_in_pts = AV_NOPTS_VALUE;
|
||||||
|
|
||||||
av_get_channel_layout_string(buf1, sizeof(buf1),
|
av_get_channel_layout_string(buf1, sizeof(buf1),
|
||||||
-1, inlink ->channel_layout);
|
-1, inlink ->channel_layout);
|
||||||
@ -254,7 +256,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
|||||||
}
|
}
|
||||||
|
|
||||||
out->sample_rate = outlink->sample_rate;
|
out->sample_rate = outlink->sample_rate;
|
||||||
if (in->pts != AV_NOPTS_VALUE) {
|
/* Only convert in->pts if there is a discontinuous jump.
|
||||||
|
This ensures that out->pts tracks the number of samples actually
|
||||||
|
output by the resampler in the absence of such a jump.
|
||||||
|
Otherwise, the rounding in av_rescale_q() and av_rescale()
|
||||||
|
causes off-by-1 errors. */
|
||||||
|
if (in->pts != AV_NOPTS_VALUE && in->pts != s->next_in_pts) {
|
||||||
out->pts = av_rescale_q(in->pts, inlink->time_base,
|
out->pts = av_rescale_q(in->pts, inlink->time_base,
|
||||||
outlink->time_base) -
|
outlink->time_base) -
|
||||||
av_rescale(delay, outlink->sample_rate,
|
av_rescale(delay, outlink->sample_rate,
|
||||||
@ -263,6 +270,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
|||||||
out->pts = s->next_pts;
|
out->pts = s->next_pts;
|
||||||
|
|
||||||
s->next_pts = out->pts + out->nb_samples;
|
s->next_pts = out->pts + out->nb_samples;
|
||||||
|
s->next_in_pts = in->pts + in->nb_samples;
|
||||||
|
|
||||||
ret = ff_filter_frame(outlink, out);
|
ret = ff_filter_frame(outlink, out);
|
||||||
s->got_output = 1;
|
s->got_output = 1;
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
#include "formats.h"
|
#include "formats.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
|
#include "libavutil/ffversion.h"
|
||||||
|
const char av_filter_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||||
|
|
||||||
static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame);
|
static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame);
|
||||||
|
|
||||||
void ff_tlog_ref(void *ctx, AVFrame *ref, int end)
|
void ff_tlog_ref(void *ctx, AVFrame *ref, int end)
|
||||||
|
@ -48,7 +48,7 @@ typedef struct {
|
|||||||
} MotionVector;
|
} MotionVector;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
MotionVector vector; ///< Motion vector
|
MotionVector vec; ///< Motion vector
|
||||||
double angle; ///< Angle of rotation
|
double angle; ///< Angle of rotation
|
||||||
double zoom; ///< Zoom percentage
|
double zoom; ///< Zoom percentage
|
||||||
} Transform;
|
} Transform;
|
||||||
|
@ -52,6 +52,8 @@ static av_cold int split_init(AVFilterContext *ctx)
|
|||||||
snprintf(name, sizeof(name), "output%d", i);
|
snprintf(name, sizeof(name), "output%d", i);
|
||||||
pad.type = ctx->filter->inputs[0].type;
|
pad.type = ctx->filter->inputs[0].type;
|
||||||
pad.name = av_strdup(name);
|
pad.name = av_strdup(name);
|
||||||
|
if (!pad.name)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
ff_insert_outpad(ctx, i, &pad);
|
ff_insert_outpad(ctx, i, &pad);
|
||||||
}
|
}
|
||||||
|
@ -289,6 +289,8 @@ static av_cold int movie_common_init(AVFilterContext *ctx)
|
|||||||
snprintf(name, sizeof(name), "out%d", i);
|
snprintf(name, sizeof(name), "out%d", i);
|
||||||
pad.type = movie->st[i].st->codec->codec_type;
|
pad.type = movie->st[i].st->codec->codec_type;
|
||||||
pad.name = av_strdup(name);
|
pad.name = av_strdup(name);
|
||||||
|
if (!pad.name)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
pad.config_props = movie_config_output_props;
|
pad.config_props = movie_config_output_props;
|
||||||
pad.request_frame = movie_request_frame;
|
pad.request_frame = movie_request_frame;
|
||||||
ff_insert_outpad(ctx, i, &pad);
|
ff_insert_outpad(ctx, i, &pad);
|
||||||
|
@ -294,8 +294,8 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
|
|||||||
for (x = 0; x < deshake->rx * 2 + 1; x++) {
|
for (x = 0; x < deshake->rx * 2 + 1; x++) {
|
||||||
//av_log(NULL, AV_LOG_ERROR, "%5d ", deshake->counts[x][y]);
|
//av_log(NULL, AV_LOG_ERROR, "%5d ", deshake->counts[x][y]);
|
||||||
if (deshake->counts[x][y] > count_max_value) {
|
if (deshake->counts[x][y] > count_max_value) {
|
||||||
t->vector.x = x - deshake->rx;
|
t->vec.x = x - deshake->rx;
|
||||||
t->vector.y = y - deshake->ry;
|
t->vec.y = y - deshake->ry;
|
||||||
count_max_value = deshake->counts[x][y];
|
count_max_value = deshake->counts[x][y];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -304,12 +304,12 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
|
|||||||
|
|
||||||
p_x = (center_x - width / 2.0);
|
p_x = (center_x - width / 2.0);
|
||||||
p_y = (center_y - height / 2.0);
|
p_y = (center_y - height / 2.0);
|
||||||
t->vector.x += (cos(t->angle)-1)*p_x - sin(t->angle)*p_y;
|
t->vec.x += (cos(t->angle)-1)*p_x - sin(t->angle)*p_y;
|
||||||
t->vector.y += sin(t->angle)*p_x + (cos(t->angle)-1)*p_y;
|
t->vec.y += sin(t->angle)*p_x + (cos(t->angle)-1)*p_y;
|
||||||
|
|
||||||
// Clamp max shift & rotation?
|
// Clamp max shift & rotation?
|
||||||
t->vector.x = av_clipf(t->vector.x, -deshake->rx * 2, deshake->rx * 2);
|
t->vec.x = av_clipf(t->vec.x, -deshake->rx * 2, deshake->rx * 2);
|
||||||
t->vector.y = av_clipf(t->vector.y, -deshake->ry * 2, deshake->ry * 2);
|
t->vec.y = av_clipf(t->vec.y, -deshake->ry * 2, deshake->ry * 2);
|
||||||
t->angle = av_clipf(t->angle, -0.1, 0.1);
|
t->angle = av_clipf(t->angle, -0.1, 0.1);
|
||||||
|
|
||||||
//av_log(NULL, AV_LOG_ERROR, "%d x %d\n", avg->x, avg->y);
|
//av_log(NULL, AV_LOG_ERROR, "%d x %d\n", avg->x, avg->y);
|
||||||
@ -407,8 +407,8 @@ static int config_props(AVFilterLink *link)
|
|||||||
DeshakeContext *deshake = link->dst->priv;
|
DeshakeContext *deshake = link->dst->priv;
|
||||||
|
|
||||||
deshake->ref = NULL;
|
deshake->ref = NULL;
|
||||||
deshake->last.vector.x = 0;
|
deshake->last.vec.x = 0;
|
||||||
deshake->last.vector.y = 0;
|
deshake->last.vec.y = 0;
|
||||||
deshake->last.angle = 0;
|
deshake->last.angle = 0;
|
||||||
deshake->last.zoom = 0;
|
deshake->last.zoom = 0;
|
||||||
|
|
||||||
@ -476,57 +476,57 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
|
|||||||
|
|
||||||
|
|
||||||
// Copy transform so we can output it later to compare to the smoothed value
|
// Copy transform so we can output it later to compare to the smoothed value
|
||||||
orig.vector.x = t.vector.x;
|
orig.vec.x = t.vec.x;
|
||||||
orig.vector.y = t.vector.y;
|
orig.vec.y = t.vec.y;
|
||||||
orig.angle = t.angle;
|
orig.angle = t.angle;
|
||||||
orig.zoom = t.zoom;
|
orig.zoom = t.zoom;
|
||||||
|
|
||||||
// Generate a one-sided moving exponential average
|
// Generate a one-sided moving exponential average
|
||||||
deshake->avg.vector.x = alpha * t.vector.x + (1.0 - alpha) * deshake->avg.vector.x;
|
deshake->avg.vec.x = alpha * t.vec.x + (1.0 - alpha) * deshake->avg.vec.x;
|
||||||
deshake->avg.vector.y = alpha * t.vector.y + (1.0 - alpha) * deshake->avg.vector.y;
|
deshake->avg.vec.y = alpha * t.vec.y + (1.0 - alpha) * deshake->avg.vec.y;
|
||||||
deshake->avg.angle = alpha * t.angle + (1.0 - alpha) * deshake->avg.angle;
|
deshake->avg.angle = alpha * t.angle + (1.0 - alpha) * deshake->avg.angle;
|
||||||
deshake->avg.zoom = alpha * t.zoom + (1.0 - alpha) * deshake->avg.zoom;
|
deshake->avg.zoom = alpha * t.zoom + (1.0 - alpha) * deshake->avg.zoom;
|
||||||
|
|
||||||
// Remove the average from the current motion to detect the motion that
|
// Remove the average from the current motion to detect the motion that
|
||||||
// is not on purpose, just as jitter from bumping the camera
|
// is not on purpose, just as jitter from bumping the camera
|
||||||
t.vector.x -= deshake->avg.vector.x;
|
t.vec.x -= deshake->avg.vec.x;
|
||||||
t.vector.y -= deshake->avg.vector.y;
|
t.vec.y -= deshake->avg.vec.y;
|
||||||
t.angle -= deshake->avg.angle;
|
t.angle -= deshake->avg.angle;
|
||||||
t.zoom -= deshake->avg.zoom;
|
t.zoom -= deshake->avg.zoom;
|
||||||
|
|
||||||
// Invert the motion to undo it
|
// Invert the motion to undo it
|
||||||
t.vector.x *= -1;
|
t.vec.x *= -1;
|
||||||
t.vector.y *= -1;
|
t.vec.y *= -1;
|
||||||
t.angle *= -1;
|
t.angle *= -1;
|
||||||
|
|
||||||
// Write statistics to file
|
// Write statistics to file
|
||||||
if (deshake->fp) {
|
if (deshake->fp) {
|
||||||
snprintf(tmp, 256, "%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", orig.vector.x, deshake->avg.vector.x, t.vector.x, orig.vector.y, deshake->avg.vector.y, t.vector.y, orig.angle, deshake->avg.angle, t.angle, orig.zoom, deshake->avg.zoom, t.zoom);
|
snprintf(tmp, 256, "%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", orig.vec.x, deshake->avg.vec.x, t.vec.x, orig.vec.y, deshake->avg.vec.y, t.vec.y, orig.angle, deshake->avg.angle, t.angle, orig.zoom, deshake->avg.zoom, t.zoom);
|
||||||
fwrite(tmp, sizeof(char), strlen(tmp), deshake->fp);
|
fwrite(tmp, sizeof(char), strlen(tmp), deshake->fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Turn relative current frame motion into absolute by adding it to the
|
// Turn relative current frame motion into absolute by adding it to the
|
||||||
// last absolute motion
|
// last absolute motion
|
||||||
t.vector.x += deshake->last.vector.x;
|
t.vec.x += deshake->last.vec.x;
|
||||||
t.vector.y += deshake->last.vector.y;
|
t.vec.y += deshake->last.vec.y;
|
||||||
t.angle += deshake->last.angle;
|
t.angle += deshake->last.angle;
|
||||||
t.zoom += deshake->last.zoom;
|
t.zoom += deshake->last.zoom;
|
||||||
|
|
||||||
// Shrink motion by 10% to keep things centered in the camera frame
|
// Shrink motion by 10% to keep things centered in the camera frame
|
||||||
t.vector.x *= 0.9;
|
t.vec.x *= 0.9;
|
||||||
t.vector.y *= 0.9;
|
t.vec.y *= 0.9;
|
||||||
t.angle *= 0.9;
|
t.angle *= 0.9;
|
||||||
|
|
||||||
// Store the last absolute motion information
|
// Store the last absolute motion information
|
||||||
deshake->last.vector.x = t.vector.x;
|
deshake->last.vec.x = t.vec.x;
|
||||||
deshake->last.vector.y = t.vector.y;
|
deshake->last.vec.y = t.vec.y;
|
||||||
deshake->last.angle = t.angle;
|
deshake->last.angle = t.angle;
|
||||||
deshake->last.zoom = t.zoom;
|
deshake->last.zoom = t.zoom;
|
||||||
|
|
||||||
// Generate a luma transformation matrix
|
// Generate a luma transformation matrix
|
||||||
avfilter_get_matrix(t.vector.x, t.vector.y, t.angle, 1.0 + t.zoom / 100.0, matrix_y);
|
avfilter_get_matrix(t.vec.x, t.vec.y, t.angle, 1.0 + t.zoom / 100.0, matrix_y);
|
||||||
// Generate a chroma transformation matrix
|
// Generate a chroma transformation matrix
|
||||||
avfilter_get_matrix(t.vector.x / (link->w / CHROMA_WIDTH(link)), t.vector.y / (link->h / CHROMA_HEIGHT(link)), t.angle, 1.0 + t.zoom / 100.0, matrix_uv);
|
avfilter_get_matrix(t.vec.x / (link->w / CHROMA_WIDTH(link)), t.vec.y / (link->h / CHROMA_HEIGHT(link)), t.angle, 1.0 + t.zoom / 100.0, matrix_uv);
|
||||||
// Transform the luma and chroma planes
|
// Transform the luma and chroma planes
|
||||||
ret = deshake->transform(link->dst, link->w, link->h, CHROMA_WIDTH(link), CHROMA_HEIGHT(link),
|
ret = deshake->transform(link->dst, link->w, link->h, CHROMA_WIDTH(link), CHROMA_HEIGHT(link),
|
||||||
matrix_y, matrix_uv, INTERPOLATE_BILINEAR, deshake->edge, in, out);
|
matrix_y, matrix_uv, INTERPOLATE_BILINEAR, deshake->edge, in, out);
|
||||||
|
@ -716,6 +716,8 @@ static av_cold void uninit(AVFilterContext *ctx)
|
|||||||
#if FF_API_DRAWTEXT_OLD_TIMELINE
|
#if FF_API_DRAWTEXT_OLD_TIMELINE
|
||||||
av_expr_free(s->draw_pexpr);
|
av_expr_free(s->draw_pexpr);
|
||||||
s->x_pexpr = s->y_pexpr = s->draw_pexpr = NULL;
|
s->x_pexpr = s->y_pexpr = s->draw_pexpr = NULL;
|
||||||
|
#else
|
||||||
|
s->x_pexpr = s->y_pexpr = NULL;
|
||||||
#endif
|
#endif
|
||||||
av_freep(&s->positions);
|
av_freep(&s->positions);
|
||||||
s->nb_positions = 0;
|
s->nb_positions = 0;
|
||||||
|
@ -161,15 +161,32 @@ static double compute_gammaval(void *opaque, double gamma)
|
|||||||
return pow((val-minval)/(maxval-minval), gamma) * (maxval-minval)+minval;
|
return pow((val-minval)/(maxval-minval), gamma) * (maxval-minval)+minval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compute Rec.709 gama correction of value val
|
||||||
|
*/
|
||||||
|
static double compute_gammaval709(void *opaque, double gamma)
|
||||||
|
{
|
||||||
|
LutContext *s = opaque;
|
||||||
|
double val = s->var_values[VAR_CLIPVAL];
|
||||||
|
double minval = s->var_values[VAR_MINVAL];
|
||||||
|
double maxval = s->var_values[VAR_MAXVAL];
|
||||||
|
double level = (val - minval) / (maxval - minval);
|
||||||
|
level = level < 0.018 ? 4.5 * level
|
||||||
|
: 1.099 * pow(level, 1.0 / gamma) - 0.099;
|
||||||
|
return level * (maxval - minval) + minval;
|
||||||
|
}
|
||||||
|
|
||||||
static double (* const funcs1[])(void *, double) = {
|
static double (* const funcs1[])(void *, double) = {
|
||||||
(void *)clip,
|
(void *)clip,
|
||||||
(void *)compute_gammaval,
|
(void *)compute_gammaval,
|
||||||
|
(void *)compute_gammaval709,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char * const funcs1_names[] = {
|
static const char * const funcs1_names[] = {
|
||||||
"clip",
|
"clip",
|
||||||
"gammaval",
|
"gammaval",
|
||||||
|
"gammaval709",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -220,6 +220,19 @@ static int config_props(AVFilterLink *inlink)
|
|||||||
|
|
||||||
#define NB_PLANES 4
|
#define NB_PLANES 4
|
||||||
|
|
||||||
|
static inline int mirror(int x, int w)
|
||||||
|
{
|
||||||
|
if (!w)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
while ((unsigned)x > (unsigned)w) {
|
||||||
|
x = -x;
|
||||||
|
if (x < 0)
|
||||||
|
x += 2 * w;
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
static void blur(uint8_t *dst, const int dst_linesize,
|
static void blur(uint8_t *dst, const int dst_linesize,
|
||||||
const uint8_t *src, const int src_linesize,
|
const uint8_t *src, const int src_linesize,
|
||||||
const int w, const int h, FilterParam *fp)
|
const int w, const int h, FilterParam *fp)
|
||||||
@ -253,8 +266,7 @@ static void blur(uint8_t *dst, const int dst_linesize,
|
|||||||
for (dy = 0; dy < radius*2 + 1; dy++) {
|
for (dy = 0; dy < radius*2 + 1; dy++) {
|
||||||
int dx;
|
int dx;
|
||||||
int iy = y+dy - radius;
|
int iy = y+dy - radius;
|
||||||
if (iy < 0) iy = -iy;
|
iy = mirror(iy, h-1);
|
||||||
else if (iy >= h) iy = h+h-iy-1;
|
|
||||||
|
|
||||||
for (dx = 0; dx < radius*2 + 1; dx++) {
|
for (dx = 0; dx < radius*2 + 1; dx++) {
|
||||||
const int ix = x+dx - radius;
|
const int ix = x+dx - radius;
|
||||||
@ -265,13 +277,11 @@ static void blur(uint8_t *dst, const int dst_linesize,
|
|||||||
for (dy = 0; dy < radius*2+1; dy++) {
|
for (dy = 0; dy < radius*2+1; dy++) {
|
||||||
int dx;
|
int dx;
|
||||||
int iy = y+dy - radius;
|
int iy = y+dy - radius;
|
||||||
if (iy < 0) iy = -iy;
|
iy = mirror(iy, h-1);
|
||||||
else if (iy >= h) iy = h+h-iy-1;
|
|
||||||
|
|
||||||
for (dx = 0; dx < radius*2 + 1; dx++) {
|
for (dx = 0; dx < radius*2 + 1; dx++) {
|
||||||
int ix = x+dx - radius;
|
int ix = x+dx - radius;
|
||||||
if (ix < 0) ix = -ix;
|
ix = mirror(ix, w-1);
|
||||||
else if (ix >= w) ix = w+w-ix-1;
|
|
||||||
UPDATE_FACTOR;
|
UPDATE_FACTOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -557,10 +557,10 @@ static const AVOption scale_options[] = {
|
|||||||
{ "mpeg", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG}, 0, 0, FLAGS, "range" },
|
{ "mpeg", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG}, 0, 0, FLAGS, "range" },
|
||||||
{ "tv", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG}, 0, 0, FLAGS, "range" },
|
{ "tv", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG}, 0, 0, FLAGS, "range" },
|
||||||
{ "pc", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG}, 0, 0, FLAGS, "range" },
|
{ "pc", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG}, 0, 0, FLAGS, "range" },
|
||||||
{ "in_v_chr_pos", "input vertical chroma position in luma grid/256" , OFFSET(in_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
|
{ "in_v_chr_pos", "input vertical chroma position in luma grid/256" , OFFSET(in_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512, FLAGS },
|
||||||
{ "in_h_chr_pos", "input horizontal chroma position in luma grid/256", OFFSET(in_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
|
{ "in_h_chr_pos", "input horizontal chroma position in luma grid/256", OFFSET(in_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512, FLAGS },
|
||||||
{ "out_v_chr_pos", "output vertical chroma position in luma grid/256" , OFFSET(out_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
|
{ "out_v_chr_pos", "output vertical chroma position in luma grid/256" , OFFSET(out_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512, FLAGS },
|
||||||
{ "out_h_chr_pos", "output horizontal chroma position in luma grid/256", OFFSET(out_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
|
{ "out_h_chr_pos", "output horizontal chroma position in luma grid/256", OFFSET(out_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512, FLAGS },
|
||||||
{ "force_original_aspect_ratio", "decrease or increase w/h if necessary to keep the original AR", OFFSET(force_original_aspect_ratio), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 2, FLAGS, "force_oar" },
|
{ "force_original_aspect_ratio", "decrease or increase w/h if necessary to keep the original AR", OFFSET(force_original_aspect_ratio), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 2, FLAGS, "force_oar" },
|
||||||
{ "disable", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 0, FLAGS, "force_oar" },
|
{ "disable", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 0, FLAGS, "force_oar" },
|
||||||
{ "decrease", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 0, FLAGS, "force_oar" },
|
{ "decrease", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 0, FLAGS, "force_oar" },
|
||||||
|
@ -55,8 +55,10 @@ static int ape_tag_read_field(AVFormatContext *s)
|
|||||||
av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
|
av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (size >= UINT_MAX)
|
if (size > INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
|
||||||
return -1;
|
av_log(s, AV_LOG_ERROR, "APE tag size too large.\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
if (flags & APE_TAG_FLAG_IS_BINARY) {
|
if (flags & APE_TAG_FLAG_IS_BINARY) {
|
||||||
uint8_t filename[1024];
|
uint8_t filename[1024];
|
||||||
enum AVCodecID id;
|
enum AVCodecID id;
|
||||||
|
@ -916,7 +916,7 @@ typedef struct AVStream {
|
|||||||
/**
|
/**
|
||||||
* Stream information used internally by av_find_stream_info()
|
* Stream information used internally by av_find_stream_info()
|
||||||
*/
|
*/
|
||||||
#define MAX_STD_TIMEBASES (60*12+6)
|
#define MAX_STD_TIMEBASES (30*12+7+6)
|
||||||
struct {
|
struct {
|
||||||
int64_t last_dts;
|
int64_t last_dts;
|
||||||
int64_t duration_gcd;
|
int64_t duration_gcd;
|
||||||
|
@ -1141,7 +1141,7 @@ start_sync:
|
|||||||
goto start_sync;
|
goto start_sync;
|
||||||
}
|
}
|
||||||
|
|
||||||
n = avi->dv_demux ? 0 : get_stream_idx(d);
|
n = get_stream_idx(d);
|
||||||
|
|
||||||
if (!((i - avi->last_pkt_pos) & 1) &&
|
if (!((i - avi->last_pkt_pos) & 1) &&
|
||||||
get_stream_idx(d + 1) < s->nb_streams)
|
get_stream_idx(d + 1) < s->nb_streams)
|
||||||
@ -1153,6 +1153,9 @@ start_sync:
|
|||||||
goto start_sync;
|
goto start_sync;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (avi->dv_demux && n != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
// parse ##dc/##wb
|
// parse ##dc/##wb
|
||||||
if (n < s->nb_streams) {
|
if (n < s->nb_streams) {
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
|
@ -221,6 +221,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
|
|||||||
return offset1;
|
return offset1;
|
||||||
offset += offset1;
|
offset += offset1;
|
||||||
}
|
}
|
||||||
|
if (offset < 0)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
offset1 = offset - pos;
|
offset1 = offset - pos;
|
||||||
if (!s->must_flush && (!s->direct || !s->seek) &&
|
if (!s->must_flush && (!s->direct || !s->seek) &&
|
||||||
offset1 >= 0 && offset1 <= buffer_size) {
|
offset1 >= 0 && offset1 <= buffer_size) {
|
||||||
@ -674,7 +677,7 @@ int ff_get_line(AVIOContext *s, char *buf, int maxlen)
|
|||||||
if (c && i < maxlen-1)
|
if (c && i < maxlen-1)
|
||||||
buf[i++] = c;
|
buf[i++] = c;
|
||||||
} while (c != '\n' && c != '\r' && c);
|
} while (c != '\n' && c != '\r' && c);
|
||||||
if (c == '\r' && avio_r8(s) != '\n')
|
if (c == '\r' && avio_r8(s) != '\n' && !avio_feof(s))
|
||||||
avio_skip(s, -1);
|
avio_skip(s, -1);
|
||||||
|
|
||||||
buf[i] = 0;
|
buf[i] = 0;
|
||||||
|
@ -127,6 +127,8 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
height = AV_RB16(&cdxl->header[16]);
|
height = AV_RB16(&cdxl->header[16]);
|
||||||
palette_size = AV_RB16(&cdxl->header[20]);
|
palette_size = AV_RB16(&cdxl->header[20]);
|
||||||
audio_size = AV_RB16(&cdxl->header[22]);
|
audio_size = AV_RB16(&cdxl->header[22]);
|
||||||
|
if (FFALIGN(width, 16) * (uint64_t)height * cdxl->header[19] > INT_MAX)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
image_size = FFALIGN(width, 16) * height * cdxl->header[19] / 8;
|
image_size = FFALIGN(width, 16) * height * cdxl->header[19] / 8;
|
||||||
video_size = palette_size + image_size;
|
video_size = palette_size + image_size;
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "libavcodec/bmp.h"
|
#include "libavcodec/bmp.h"
|
||||||
|
#include "libavutil/intfloat.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
@ -78,6 +79,16 @@ static int set_metadata_int(AVDictionary **dict, const char *key, int value, int
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int set_metadata_float(AVDictionary **dict, const char *key, float value, int allow_zero)
|
||||||
|
{
|
||||||
|
if (value != 0 || allow_zero) {
|
||||||
|
char tmp[64];
|
||||||
|
snprintf(tmp, sizeof(tmp), "%f", value);
|
||||||
|
return av_dict_set(dict, key, tmp, 0);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int cine_read_header(AVFormatContext *avctx)
|
static int cine_read_header(AVFormatContext *avctx)
|
||||||
{
|
{
|
||||||
AVIOContext *pb = avctx->pb;
|
AVIOContext *pb = avctx->pb;
|
||||||
@ -177,7 +188,10 @@ static int cine_read_header(AVFormatContext *avctx)
|
|||||||
set_metadata_int(&st->metadata, "contrast", avio_rl32(pb), 1);
|
set_metadata_int(&st->metadata, "contrast", avio_rl32(pb), 1);
|
||||||
set_metadata_int(&st->metadata, "gamma", avio_rl32(pb), 1);
|
set_metadata_int(&st->metadata, "gamma", avio_rl32(pb), 1);
|
||||||
|
|
||||||
avio_skip(pb, 72); // Reserved1 .. WBView
|
avio_skip(pb, 12 + 16); // Reserved1 .. AutoExpRect
|
||||||
|
set_metadata_float(&st->metadata, "wbgain[0].r", av_int2float(avio_rl32(pb)), 1);
|
||||||
|
set_metadata_float(&st->metadata, "wbgain[0].b", av_int2float(avio_rl32(pb)), 1);
|
||||||
|
avio_skip(pb, 36); // WBGain[1].. WBView
|
||||||
|
|
||||||
st->codec->bits_per_coded_sample = avio_rl32(pb);
|
st->codec->bits_per_coded_sample = avio_rl32(pb);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ static int dts_probe(AVProbeData *p)
|
|||||||
{
|
{
|
||||||
const uint8_t *buf, *bufp;
|
const uint8_t *buf, *bufp;
|
||||||
uint32_t state = -1;
|
uint32_t state = -1;
|
||||||
int markers[4] = {0};
|
int markers[4*16] = {0};
|
||||||
int sum, max, i;
|
int sum, max, i;
|
||||||
int64_t diff = 0;
|
int64_t diff = 0;
|
||||||
uint8_t hdr[12 + FF_INPUT_BUFFER_PADDING_SIZE] = { 0 };
|
uint8_t hdr[12 + FF_INPUT_BUFFER_PADDING_SIZE] = { 0 };
|
||||||
@ -43,6 +43,7 @@ static int dts_probe(AVProbeData *p)
|
|||||||
|
|
||||||
for(; buf < (p->buf+p->buf_size)-2; buf+=2) {
|
for(; buf < (p->buf+p->buf_size)-2; buf+=2) {
|
||||||
int marker, sample_blocks, sample_rate, sr_code, framesize;
|
int marker, sample_blocks, sample_rate, sr_code, framesize;
|
||||||
|
int lfe;
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
|
|
||||||
bufp = buf;
|
bufp = buf;
|
||||||
@ -89,13 +90,27 @@ static int dts_probe(AVProbeData *p)
|
|||||||
if (sample_rate == 0)
|
if (sample_rate == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
get_bits(&gb, 5);
|
||||||
|
if (get_bits(&gb, 1))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
skip_bits_long(&gb, 9);
|
||||||
|
lfe = get_bits(&gb, 2);
|
||||||
|
if (lfe > 2)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
marker += 4* sr_code;
|
||||||
|
|
||||||
markers[marker] ++;
|
markers[marker] ++;
|
||||||
}
|
}
|
||||||
sum = markers[0] + markers[1] + markers[2] + markers[3];
|
|
||||||
max = 0;
|
sum = max = 0;
|
||||||
for (i=1; i<4; i++)
|
for (i=0; i<FF_ARRAY_ELEMS(markers); i++) {
|
||||||
|
sum += markers[i];
|
||||||
if (markers[max] < markers[i])
|
if (markers[max] < markers[i])
|
||||||
max = i;
|
max = i;
|
||||||
|
}
|
||||||
|
|
||||||
if (markers[max] > 3 && p->buf_size / markers[max] < 32*1024 &&
|
if (markers[max] > 3 && p->buf_size / markers[max] < 32*1024 &&
|
||||||
markers[max] * 4 > sum * 3 &&
|
markers[max] * 4 > sum * 3 &&
|
||||||
diff / p->buf_size > 200)
|
diff / p->buf_size > 200)
|
||||||
|
@ -390,7 +390,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
|
|||||||
FLVContext *flv = s->priv_data;
|
FLVContext *flv = s->priv_data;
|
||||||
AVIOContext *ioc;
|
AVIOContext *ioc;
|
||||||
AMFDataType amf_type;
|
AMFDataType amf_type;
|
||||||
char str_val[256];
|
char str_val[1024];
|
||||||
double num_val;
|
double num_val;
|
||||||
|
|
||||||
num_val = 0;
|
num_val = 0;
|
||||||
@ -459,11 +459,11 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (key) {
|
if (key) {
|
||||||
|
acodec = astream ? astream->codec : NULL;
|
||||||
|
vcodec = vstream ? vstream->codec : NULL;
|
||||||
|
|
||||||
// stream info doesn't live any deeper than the first object
|
// stream info doesn't live any deeper than the first object
|
||||||
if (depth == 1) {
|
if (depth == 1) {
|
||||||
acodec = astream ? astream->codec : NULL;
|
|
||||||
vcodec = vstream ? vstream->codec : NULL;
|
|
||||||
|
|
||||||
if (amf_type == AMF_DATA_TYPE_NUMBER ||
|
if (amf_type == AMF_DATA_TYPE_NUMBER ||
|
||||||
amf_type == AMF_DATA_TYPE_BOOL) {
|
amf_type == AMF_DATA_TYPE_BOOL) {
|
||||||
if (!strcmp(key, "duration"))
|
if (!strcmp(key, "duration"))
|
||||||
@ -558,13 +558,13 @@ static int flv_read_metabody(AVFormatContext *s, int64_t next_pos)
|
|||||||
type = avio_r8(ioc);
|
type = avio_r8(ioc);
|
||||||
if (type != AMF_DATA_TYPE_STRING ||
|
if (type != AMF_DATA_TYPE_STRING ||
|
||||||
amf_get_string(ioc, buffer, sizeof(buffer)) < 0)
|
amf_get_string(ioc, buffer, sizeof(buffer)) < 0)
|
||||||
return -1;
|
return 2;
|
||||||
|
|
||||||
if (!strcmp(buffer, "onTextData"))
|
if (!strcmp(buffer, "onTextData"))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (strcmp(buffer, "onMetaData") && strcmp(buffer, "onCuePoint"))
|
if (strcmp(buffer, "onMetaData") && strcmp(buffer, "onCuePoint"))
|
||||||
return -1;
|
return 2;
|
||||||
|
|
||||||
// find the streams now so that amf_parse_object doesn't need to do
|
// find the streams now so that amf_parse_object doesn't need to do
|
||||||
// the lookup every time it is called.
|
// the lookup every time it is called.
|
||||||
@ -623,7 +623,7 @@ static int flv_read_close(AVFormatContext *s)
|
|||||||
|
|
||||||
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
|
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
|
||||||
{
|
{
|
||||||
av_free(st->codec->extradata);
|
av_freep(&st->codec->extradata);
|
||||||
if (ff_get_extradata(st->codec, s->pb, size) < 0)
|
if (ff_get_extradata(st->codec, s->pb, size) < 0)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
return 0;
|
return 0;
|
||||||
@ -822,7 +822,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
stream_type=FLV_STREAM_TYPE_DATA;
|
stream_type=FLV_STREAM_TYPE_DATA;
|
||||||
if (size > 13 + 1 + 4 && dts == 0) { // Header-type metadata stuff
|
if (size > 13 + 1 + 4 && dts == 0) { // Header-type metadata stuff
|
||||||
meta_pos = avio_tell(s->pb);
|
meta_pos = avio_tell(s->pb);
|
||||||
if (flv_read_metabody(s, next) == 0) {
|
if (flv_read_metabody(s, next) <= 0) {
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
avio_seek(s->pb, meta_pos, SEEK_SET);
|
avio_seek(s->pb, meta_pos, SEEK_SET);
|
||||||
|
@ -145,15 +145,15 @@ static void hds_free(AVFormatContext *s)
|
|||||||
if (os->ctx && os->ctx_inited)
|
if (os->ctx && os->ctx_inited)
|
||||||
av_write_trailer(os->ctx);
|
av_write_trailer(os->ctx);
|
||||||
if (os->ctx && os->ctx->pb)
|
if (os->ctx && os->ctx->pb)
|
||||||
av_free(os->ctx->pb);
|
av_freep(&os->ctx->pb);
|
||||||
if (os->ctx)
|
if (os->ctx)
|
||||||
avformat_free_context(os->ctx);
|
avformat_free_context(os->ctx);
|
||||||
av_free(os->metadata);
|
av_freep(&os->metadata);
|
||||||
for (j = 0; j < os->nb_extra_packets; j++)
|
for (j = 0; j < os->nb_extra_packets; j++)
|
||||||
av_free(os->extra_packets[j]);
|
av_freep(&os->extra_packets[j]);
|
||||||
for (j = 0; j < os->nb_fragments; j++)
|
for (j = 0; j < os->nb_fragments; j++)
|
||||||
av_free(os->fragments[j]);
|
av_freep(&os->fragments[j]);
|
||||||
av_free(os->fragments);
|
av_freep(&os->fragments);
|
||||||
}
|
}
|
||||||
av_freep(&c->streams);
|
av_freep(&c->streams);
|
||||||
}
|
}
|
||||||
@ -506,7 +506,7 @@ static int hds_flush(AVFormatContext *s, OutputStream *os, int final,
|
|||||||
if (remove > 0) {
|
if (remove > 0) {
|
||||||
for (i = 0; i < remove; i++) {
|
for (i = 0; i < remove; i++) {
|
||||||
unlink(os->fragments[i]->file);
|
unlink(os->fragments[i]->file);
|
||||||
av_free(os->fragments[i]);
|
av_freep(&os->fragments[i]);
|
||||||
}
|
}
|
||||||
os->nb_fragments -= remove;
|
os->nb_fragments -= remove;
|
||||||
memmove(os->fragments, os->fragments + remove,
|
memmove(os->fragments, os->fragments + remove,
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user