Compare commits
350 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2e00dd4d62 | ||
![]() |
91138821fb | ||
![]() |
a4681d1043 | ||
![]() |
151c2ca8c7 | ||
![]() |
dafd8228bc | ||
![]() |
d9ab7c6292 | ||
![]() |
426715ccbd | ||
![]() |
a4e3bb0106 | ||
![]() |
cd2d8aca84 | ||
![]() |
e9d9fd1137 | ||
![]() |
e4bae0a140 | ||
![]() |
520c3d2303 | ||
![]() |
82a627c2c3 | ||
![]() |
0cb4887b83 | ||
![]() |
4a45535836 | ||
![]() |
4427e96bb1 | ||
![]() |
731f4bb6fd | ||
![]() |
898ce4d6e2 | ||
![]() |
93f80cf2cc | ||
![]() |
204c8798a8 | ||
![]() |
9767d7513c | ||
![]() |
d2b9da2f37 | ||
![]() |
395538e073 | ||
![]() |
a367ab657f | ||
![]() |
63235b8d41 | ||
![]() |
5353bd0285 | ||
![]() |
065996b984 | ||
![]() |
1ace588f4a | ||
![]() |
50a3442120 | ||
![]() |
008ae91bcc | ||
![]() |
d2d38531d6 | ||
![]() |
600bc1deba | ||
![]() |
77a2f4cbcf | ||
![]() |
7f8b55b560 | ||
![]() |
1ab4578c88 | ||
![]() |
52ab9e8984 | ||
![]() |
2922ab7e6f | ||
![]() |
5772cbb343 | ||
![]() |
46e1d05991 | ||
![]() |
a6f7fc8f3b | ||
![]() |
0662967d2b | ||
![]() |
ddeb6eeeb1 | ||
![]() |
5aac081110 | ||
![]() |
d8745de6ae | ||
![]() |
46fd6e4f2e | ||
![]() |
6cad940989 | ||
![]() |
c046890191 | ||
![]() |
d70bad04de | ||
![]() |
c8462bd17f | ||
![]() |
a3410b5a1f | ||
![]() |
43039f9386 | ||
![]() |
d0c4d61c8b | ||
![]() |
95db1624ef | ||
![]() |
b0b33ce148 | ||
![]() |
fa4192e31f | ||
![]() |
4c412580fd | ||
![]() |
8f558c3e10 | ||
![]() |
5ebdfbe893 | ||
![]() |
094a35aeef | ||
![]() |
62f9253781 | ||
![]() |
858864d350 | ||
![]() |
ba31b72f46 | ||
![]() |
7594868296 | ||
![]() |
09e391abd8 | ||
![]() |
b90816d94b | ||
![]() |
05015d03da | ||
![]() |
34ecaf6e88 | ||
![]() |
bb46240cbb | ||
![]() |
5ee539f69d | ||
![]() |
8ba3198549 | ||
![]() |
8355383802 | ||
![]() |
c0f7df9662 | ||
![]() |
fc6825ebb6 | ||
![]() |
f074618a9f | ||
![]() |
c6dce25967 | ||
![]() |
aba56c03b9 | ||
![]() |
2e06758479 | ||
![]() |
fc7071cb53 | ||
![]() |
2dfe3a7b4d | ||
![]() |
9d5f16f6fe | ||
![]() |
dc794d7096 | ||
![]() |
31a77177ff | ||
![]() |
9b0d0fd3c4 | ||
![]() |
9925dca119 | ||
![]() |
3d5323a351 | ||
![]() |
69659389a3 | ||
![]() |
731902bd19 | ||
![]() |
85a685ac0a | ||
![]() |
bd593a98dc | ||
![]() |
6f787aa79b | ||
![]() |
1e7f825a9b | ||
![]() |
c50241080d | ||
![]() |
a0361a6c30 | ||
![]() |
22c27e1f4a | ||
![]() |
9d4355d90a | ||
![]() |
0b0e87bb54 | ||
![]() |
4fb6fa477e | ||
![]() |
c8557235fd | ||
![]() |
f719e6566c | ||
![]() |
b9a1efa6f4 | ||
![]() |
3ee967c1d8 | ||
![]() |
e44f89371c | ||
![]() |
e586e4d93b | ||
![]() |
f156dc54f8 | ||
![]() |
685f50b374 | ||
![]() |
6086a4d74d | ||
![]() |
88089eecfd | ||
![]() |
0daf1428e8 | ||
![]() |
97cc2f286f | ||
![]() |
21d568be17 | ||
![]() |
d84c51904c | ||
![]() |
0cb3cab343 | ||
![]() |
b77d9cbbd5 | ||
![]() |
905f5c8a1e | ||
![]() |
20373a66ec | ||
![]() |
d48da91373 | ||
![]() |
62a657de16 | ||
![]() |
747fbe0c21 | ||
![]() |
c1f479e8df | ||
![]() |
d3b40af01f | ||
![]() |
74880e78d8 | ||
![]() |
60dd8b5733 | ||
![]() |
77cf052e39 | ||
![]() |
146eac0a0c | ||
![]() |
4852b3aabd | ||
![]() |
41313bdcc5 | ||
![]() |
088ba9bc3e | ||
![]() |
b642e45d8c | ||
![]() |
a8fc0bb608 | ||
![]() |
7c8beec48c | ||
![]() |
992957ac30 | ||
![]() |
b3c8fd1f0e | ||
![]() |
7327505883 | ||
![]() |
a3b3096772 | ||
![]() |
704952fee5 | ||
![]() |
b6f5a1ca58 | ||
![]() |
efa8603518 | ||
![]() |
1b0082eabc | ||
![]() |
78dbb1a7e1 | ||
![]() |
4f3f2fe14b | ||
![]() |
cdbaaa4f00 | ||
![]() |
d4d1f32e48 | ||
![]() |
c6c4dc6935 | ||
![]() |
494ddd377a | ||
![]() |
37e99e384e | ||
![]() |
73d6f4651e | ||
![]() |
50ebb524cd | ||
![]() |
98e96652f1 | ||
![]() |
4bde8c1369 | ||
![]() |
ece16d91ee | ||
![]() |
3348e66e2e | ||
![]() |
6e8ed38fab | ||
![]() |
f64e4a8c9a | ||
![]() |
d92a7870d7 | ||
![]() |
5fb5ac7148 | ||
![]() |
8d3bc52acd | ||
![]() |
dc745b76aa | ||
![]() |
b6ae41e7f4 | ||
![]() |
670128ff13 | ||
![]() |
1f9073f41b | ||
![]() |
a991c0673f | ||
![]() |
77493bfd97 | ||
![]() |
bb3f1cad17 | ||
![]() |
a6403a3b69 | ||
![]() |
e2cf32ca5f | ||
![]() |
48fd461977 | ||
![]() |
612b28194b | ||
![]() |
8bce2c60b8 | ||
![]() |
488ffb8135 | ||
![]() |
b786ddc0f2 | ||
![]() |
88ae77cea4 | ||
![]() |
5bed920971 | ||
![]() |
705e89d75f | ||
![]() |
ef688e7425 | ||
![]() |
02d1efdd5b | ||
![]() |
469cb61193 | ||
![]() |
a642be972d | ||
![]() |
bc9d341be8 | ||
![]() |
80ddf7889e | ||
![]() |
4be63111d1 | ||
![]() |
6626a7df53 | ||
![]() |
ab434bf0d0 | ||
![]() |
52b18c1fde | ||
![]() |
0b2b8ab979 | ||
![]() |
65bf4c9c45 | ||
![]() |
7c40a0449b | ||
![]() |
811a504c6b | ||
![]() |
75211f2b8c | ||
![]() |
f6687bbb64 | ||
![]() |
1400f1a1e4 | ||
![]() |
1ea5bbc594 | ||
![]() |
f5955d9f6f | ||
![]() |
e14564b926 | ||
![]() |
0f5a0a4155 | ||
![]() |
7acfa7758c | ||
![]() |
56b6909b39 | ||
![]() |
c6f59b95c5 | ||
![]() |
d61c6ebccf | ||
![]() |
b9a287f237 | ||
![]() |
6407800521 | ||
![]() |
6c62098827 | ||
![]() |
a23d6ea1e4 | ||
![]() |
e492818d89 | ||
![]() |
1ca25bc387 | ||
![]() |
057051b848 | ||
![]() |
71fee2ab1e | ||
![]() |
7d3e217623 | ||
![]() |
2ac6b573a4 | ||
![]() |
7f8846405e | ||
![]() |
81bcf9454e | ||
![]() |
5a3c8f95d5 | ||
![]() |
358e4081ed | ||
![]() |
6baaaa0174 | ||
![]() |
9e3e11a348 | ||
![]() |
1d20d975aa | ||
![]() |
e67491a2a4 | ||
![]() |
e1a86b1433 | ||
![]() |
5310da7e83 | ||
![]() |
4eede1fca2 | ||
![]() |
b7765d00f9 | ||
![]() |
5479e08cc4 | ||
![]() |
d0249f1c2e | ||
![]() |
108ca6fad1 | ||
![]() |
5bee21d724 | ||
![]() |
1f8bf163e4 | ||
![]() |
7e35c50b81 | ||
![]() |
e835ce83e2 | ||
![]() |
00bf66785f | ||
![]() |
e0e4250421 | ||
![]() |
901682ff78 | ||
![]() |
5af78cc98d | ||
![]() |
59f22ef91a | ||
![]() |
5393a5600d | ||
![]() |
077beee465 | ||
![]() |
02d3ad8609 | ||
![]() |
b48cf5412b | ||
![]() |
5f3fa5f930 | ||
![]() |
0e1bb99f26 | ||
![]() |
d2c1a8dc2d | ||
![]() |
5a97a5291a | ||
![]() |
f6b50924a5 | ||
![]() |
a55c274f51 | ||
![]() |
eaa9d2cd6b | ||
![]() |
d3bec24739 | ||
![]() |
3ef1538121 | ||
![]() |
47e462eecc | ||
![]() |
f3d1670606 | ||
![]() |
9547034f91 | ||
![]() |
62c9beda0c | ||
![]() |
0e68b6ddce | ||
![]() |
75e88db330 | ||
![]() |
6baa549249 | ||
![]() |
22561bc0e9 | ||
![]() |
8a4464514f | ||
![]() |
85e94a30ee | ||
![]() |
3445bec6fc | ||
![]() |
c8dace2728 | ||
![]() |
9bcb84810f | ||
![]() |
54e19092fd | ||
![]() |
3d67f52f9d | ||
![]() |
bfd586577c | ||
![]() |
5589549c1d | ||
![]() |
5c316acaa0 | ||
![]() |
f4fb841ad1 | ||
![]() |
c2d11275f7 | ||
![]() |
b54c155f5b | ||
![]() |
ea2d44503f | ||
![]() |
59f7d583a3 | ||
![]() |
fb876e4572 | ||
![]() |
c2d2bf1d6b | ||
![]() |
302094e1d2 | ||
![]() |
8d55c2441c | ||
![]() |
d7e7e12abc | ||
![]() |
a856623e87 | ||
![]() |
348cd84fc8 | ||
![]() |
62de693a17 | ||
![]() |
33769e908d | ||
![]() |
1a28948eb3 | ||
![]() |
01050448cf | ||
![]() |
edc00dea02 | ||
![]() |
8d0631c8fa | ||
![]() |
1135928903 | ||
![]() |
6f3bc92c29 | ||
![]() |
bd531038e8 | ||
![]() |
90da0cb60e | ||
![]() |
3049d5b9b3 | ||
![]() |
43c6b45a53 | ||
![]() |
68a0477bc0 | ||
![]() |
ccf0cd967d | ||
![]() |
002ad7cd39 | ||
![]() |
397fafad23 | ||
![]() |
30f0cd2f1e | ||
![]() |
4d6d8d9ae9 | ||
![]() |
9348514a67 | ||
![]() |
17704500fb | ||
![]() |
2338eda8d8 | ||
![]() |
6a0633e961 | ||
![]() |
16dc41de27 | ||
![]() |
ab471e17e4 | ||
![]() |
3be8aeb14e | ||
![]() |
b48e251360 | ||
![]() |
65a4b90840 | ||
![]() |
59956a5957 | ||
![]() |
d4a08e560d | ||
![]() |
dacac91973 | ||
![]() |
d39400fed7 | ||
![]() |
07174ed841 | ||
![]() |
e7475335b1 | ||
![]() |
722bfe4e7c | ||
![]() |
cc8ab98656 | ||
![]() |
d7cff9f8e8 | ||
![]() |
9bfda9df71 | ||
![]() |
0a837b6317 | ||
![]() |
c3c1db7c56 | ||
![]() |
21ca4ab944 | ||
![]() |
c749bec8c3 | ||
![]() |
a95306e2d7 | ||
![]() |
ed12d1ecad | ||
![]() |
05ed9b7005 | ||
![]() |
76477c3843 | ||
![]() |
ccc4219558 | ||
![]() |
9d60f608af | ||
![]() |
6a4803a6a9 | ||
![]() |
c3b67720f9 | ||
![]() |
1c373456f6 | ||
![]() |
9636266cbd | ||
![]() |
dc3349024a | ||
![]() |
66a3112100 | ||
![]() |
72eca26bf9 | ||
![]() |
e44d56b18d | ||
![]() |
71e00caeab | ||
![]() |
7a2ee770f5 | ||
![]() |
fadebd256e | ||
![]() |
3dab6e5429 | ||
![]() |
bc182a6aca | ||
![]() |
fbde7b2d0a | ||
![]() |
58baa367d6 | ||
![]() |
ca2e3f1131 | ||
![]() |
ebd3aa429c | ||
![]() |
ddb0317154 | ||
![]() |
606aa3baee | ||
![]() |
36dac6da41 | ||
![]() |
9202824e1b | ||
![]() |
0135dd73bb | ||
![]() |
c01be297ce | ||
![]() |
42bd6d9cf6 | ||
![]() |
79013a59c0 | ||
![]() |
c1555ae4b6 | ||
![]() |
a557005417 | ||
![]() |
8069b44ebf |
126
Changelog
126
Changelog
@@ -2,6 +2,129 @@ Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version <next>:
|
||||
- aac: check the maximum number of channels to avoid invalid writes
|
||||
- indeo3: fix off by one in MV validity check
|
||||
- id3v2: check for end of file while unescaping tags to avoid invalid
|
||||
writes, reported by Google Security Team
|
||||
- afifo: fix request_samples on the last frame in certain cases
|
||||
- hls, segment: fix splitting for audio-only streams
|
||||
- wav: Always seek to an even offset, Bug #500, LP: #1174737
|
||||
- swscale: Use alpha from the right row in yuva2rgba_c, Bug #504
|
||||
- indeo3: use unaligned reads on reference blocks, Bug #503
|
||||
- oma: properly forward errors in oma_read_packet
|
||||
- af_asyncts: fix offset calculation
|
||||
|
||||
Most of the following fixes resulted from test samples that the Google
|
||||
Security Team has kindly made available to us:
|
||||
|
||||
- af_channelmap: sanity check input channel indices in all cases
|
||||
- avfiltergraph: check for sws opts being non-NULL before using them
|
||||
- bmv: check for len being valid in bmv_decode_frame()
|
||||
- configure: Enable hwaccels without external dependencies by default
|
||||
- dfa: check for invalid access in decode_wdlt()
|
||||
- id3v2: pad the APIC packets as required by lavc
|
||||
- indeo3: check motion vectors
|
||||
- indeo3: fix data size check
|
||||
- indeo3: switch parsing the header to bytestream2
|
||||
- lavf: make sure stream probe data gets freed
|
||||
- matroska: Update the available size after lace parsing
|
||||
- matroska: fix a corner case in ebml-lace parsing
|
||||
- matroska: pass the lace size to the matroska_parse_rm_audio
|
||||
- mp3dec: fallback to generic seeking when a TOC is not present
|
||||
- oggdec: fix faulty cleanup prototype
|
||||
- oma: Validate sample rates
|
||||
- qdm2: check that the FFT size is a power of 2
|
||||
- riff: check for eof if chunk size and code are 0 to prevent an infinite loop
|
||||
- rv10: check that extradata is large enough
|
||||
- svq1dec: check that the reference frame has the same dimensions as the current one
|
||||
- svq1dec: clip motion vectors to the frame size
|
||||
- xmv: check audio track parameters validity
|
||||
- xmv: do not leak memory in the error paths in xmv_read_header()
|
||||
- atrac3: avoid oversized shifting in decode_bytes()
|
||||
- eamad: allocate a dummy reference frame when the real one is missing
|
||||
- ffv1: fix calculating slice dimensions for version 2
|
||||
- flacdec: simplify bounds checking in flac_probe()
|
||||
- h264: check for luma and chroma bit dept being equal (CVE-2013-2277)
|
||||
- hqdn3d: Fix out of array read in LOWPASS
|
||||
- iff: validate CMAP palette size (CVE-2013-2495)
|
||||
- ivi_common: do not call MC for intra frames when dc_transform is unset
|
||||
- libmp3lame: use the correct remaining buffer size when flushing
|
||||
- lzo: fix overflow checking in copy_backptr()
|
||||
- mp3dec: Fix VBR bit rate parsing
|
||||
- png: use av_mallocz_array() for the zlib zalloc function
|
||||
- roqvideodec: fix a potential infinite loop in roqvideo_decode_frame()
|
||||
- shorten: fix various programming mistakes
|
||||
- vf_gradfun: fix uninitialized variable use
|
||||
- vf_hqdn3d: fix uninitialized variable use
|
||||
- vmdaudio: fix invalid reads when packet size is not a multiple of chunk size
|
||||
- wmadec: require block_align to be set
|
||||
- wmaprodec: require block_align to be set
|
||||
- wmaprodec: return an error, not 0, when the input is too small
|
||||
- xxan: fix invalid memory access in xan_decode_frame_type0()
|
||||
- h264: fix deadlocks with broken/fuzzed files
|
||||
- flvdec: make decoder more robust
|
||||
- vorbisdec: fix buffer overflow (CVE-2013-0894)
|
||||
- ac3dec: validate channel output mode against channel count
|
||||
- doc: minor improvements
|
||||
- loco: check that there is data left after decoding a plane.
|
||||
- mov: use the format context for logging.
|
||||
- lagarith: avoid infinite loop in lag_rac_refill() with corrupted files
|
||||
- flicvideo: avoid an infinite loop in byte run compression
|
||||
- av_memcpy_backptr: avoid an infinite loop for back = 0
|
||||
- mlpdec: do not try to allocate a zero-sized output buffer.
|
||||
- qtrle: add more checks against pixel_ptr being negative.
|
||||
- 4xm: check the return value of read_huffman_tables().
|
||||
- cavs: initialize various context tables, avoids crashes with corrupted files
|
||||
- x86/H.264: Don't use redzone in AVX h264_deblock on Win64
|
||||
- VQA video: check chunk sizes before reading chunks
|
||||
- RoQ video decoder: check dimensions validity
|
||||
- QDM2: check array index before use, fix out of array accesses
|
||||
- mpegvideo: Do REBASE_PICTURE with byte pointers
|
||||
- SVQ3: unbreak decoding
|
||||
- libopencore-amrwb: Make AMR-WB ifdeffery more precise
|
||||
- libopencore-amr: Conditionally compile decoder and encoder bits
|
||||
- arm: Fall back to runtime cpu feature detection via /proc/cpuinfo
|
||||
- xxan: properly handle odd heights
|
||||
- msrledec: check bounds before constructing a possibly invalid pointer (CVE-2496)
|
||||
- qtrle: fix the topmost line for 1bit
|
||||
- aasc: fix output for msrle compression
|
||||
- yop: check for input overreads
|
||||
- yop: check that extradata is large enough
|
||||
- fraps: fix off-by one bug for version 1
|
||||
- vf_delogo: fix copying the input frame
|
||||
- vf_delogo: fix an uninitialized read
|
||||
- dnxhdenc: fix invalid reads in dnxhd_mb_var_thread()
|
||||
- ATRAC3: use correct loop variable in add_tonal_components()
|
||||
- MLP: store the channel layout for each substream
|
||||
- MLP decoder: TrueHD: use Libav channel order
|
||||
- x86: ac3: Fix HAVE_MMXEXT condition to only refer to external assembly
|
||||
- arm: vp8: Fix the plain-armv6 version of vp8_luma_dc_wht
|
||||
- lavr: call mix_function_init() in ff_audio_mix_set_matrix()
|
||||
- rtpenc_chain: Use the original AVFormatContext for getting payload type
|
||||
- rtp: Make sure the output format pointer is set
|
||||
- rtp: Make sure priv_data is set before reading it
|
||||
- videodsp_armv5te: remove #if HAVE_ARMV5TE_EXTERNAL
|
||||
- get_bits: change the failure condition in init_get_bits
|
||||
- mpegvideo: fix loop condition in draw_line()
|
||||
- fate: update ref after rv30_loop_filter fix
|
||||
- RV30: fix masking in rv30_loop_filter()
|
||||
- libcdio: support recent cdio-paranoia
|
||||
- Theora: Skip zero-sized headers
|
||||
- H.264: add 3 pixels below for subpixel filter wait position
|
||||
- H.264: fix ff_generate_sliding_window_mmcos() prototype
|
||||
- H.264: don't clobber mmco opcode tables for non-first slice headers
|
||||
- libx264: use the library specific default rc_initial_buffer_occupancy
|
||||
- lavc: set the default rc_initial_buffer_occupancy
|
||||
- lavc: introduce the convenience function init_get_bits8
|
||||
- lavc: check for overflow in init_get_bits
|
||||
- configure: enable pic for shared libs on AArch64
|
||||
- zmbv: Reset the decoder on keyframe errors
|
||||
- VC1 decoder: prevent a crash due missing pred_flag parameter
|
||||
- matroska: Fix use after free
|
||||
- VP3: Fix double free in vp3_decode_end()
|
||||
- Fix a crash on windows platforms related to automatic stack alignment
|
||||
in libavresample
|
||||
- Fix memleaks in the Ogg demuxer. Related to CVE-2012-2882
|
||||
|
||||
|
||||
version 1.1:
|
||||
@@ -60,7 +183,9 @@ version 1.1:
|
||||
- support building on the Plan 9 operating system
|
||||
- kerndeint filter ported from MPlayer
|
||||
- histeq filter ported from VirtualDub
|
||||
- Megalux Frame demuxer
|
||||
- 012v decoder
|
||||
- Improved AVC Intra decoding support
|
||||
|
||||
|
||||
version 1.0:
|
||||
@@ -349,7 +474,6 @@ easier to use. The changes are:
|
||||
- Simple segmenting muxer
|
||||
- Indeo 4 decoder
|
||||
- SMJPEG demuxer
|
||||
- Megalux Frame demuxer
|
||||
|
||||
|
||||
version 0.8:
|
||||
|
@@ -445,10 +445,11 @@ x86 Michael Niedermayer
|
||||
Releases
|
||||
========
|
||||
|
||||
1.2 Michael Niedermayer
|
||||
1.1 Michael Niedermayer
|
||||
1.0 Michael Niedermayer
|
||||
0.11 Michael Niedermayer
|
||||
|
||||
If you want to maintain an older release, please contact us
|
||||
|
||||
|
||||
GnuPG Fingerprints of maintainers and contributors
|
||||
|
@@ -1851,7 +1851,7 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu
|
||||
/* XXX this shouldn't be needed, but some tests break without this line
|
||||
* those decoders are buggy and need to be fixed.
|
||||
* the following tests fail:
|
||||
* cdgraphics, ansi, aasc, fraps-v1, qtrle-1bit
|
||||
* cdgraphics, ansi
|
||||
*/
|
||||
memset(buf->base[0], 128, ret);
|
||||
|
||||
|
@@ -190,13 +190,13 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
|
||||
void show_help_children(const AVClass *class, int flags);
|
||||
|
||||
/**
|
||||
* Per-avtool specific help handler. Implemented in each
|
||||
* avtool, called by show_help().
|
||||
* Per-fftool specific help handler. Implemented in each
|
||||
* fftool, called by show_help().
|
||||
*/
|
||||
void show_help_default(const char *opt, const char *arg);
|
||||
|
||||
/**
|
||||
* Generic -h handler common to all avtools.
|
||||
* Generic -h handler common to all fftools.
|
||||
*/
|
||||
int show_help(void *optctx, const char *opt, const char *arg);
|
||||
|
||||
|
47
configure
vendored
47
configure
vendored
@@ -789,8 +789,8 @@ check_ld(){
|
||||
log check_ld "$@"
|
||||
type=$1
|
||||
shift 1
|
||||
flags=$(filter_out '-l*' $@)
|
||||
libs=$(filter '-l*' $@)
|
||||
flags=$(filter_out '-l*|*.so' $@)
|
||||
libs=$(filter '-l*|*.so' $@)
|
||||
check_$type $($cflags_filter $flags) || return
|
||||
flags=$($ldflags_filter $flags)
|
||||
libs=$($ldflags_filter $libs)
|
||||
@@ -1343,6 +1343,8 @@ HAVE_LIST="
|
||||
asm_types_h
|
||||
attribute_may_alias
|
||||
attribute_packed
|
||||
cdio_paranoia_h
|
||||
cdio_paranoia_paranoia_h
|
||||
clock_gettime
|
||||
closesocket
|
||||
cmov
|
||||
@@ -1464,6 +1466,7 @@ HAVE_LIST="
|
||||
CONFIG_EXTRA="
|
||||
aandcttables
|
||||
ac3dsp
|
||||
audio_frame_queue
|
||||
error_resilience
|
||||
gcrypt
|
||||
golomb
|
||||
@@ -1631,7 +1634,7 @@ mpegvideoenc_select="mpegvideo"
|
||||
|
||||
# decoders / encoders
|
||||
aac_decoder_select="mdct sinewin"
|
||||
aac_encoder_select="mdct sinewin"
|
||||
aac_encoder_select="audio_frame_queue mdct sinewin"
|
||||
aac_latm_decoder_select="aac_decoder aac_latm_parser"
|
||||
ac3_decoder_select="mdct ac3dsp ac3_parser"
|
||||
ac3_encoder_select="mdct ac3dsp"
|
||||
@@ -1716,13 +1719,13 @@ msmpeg4v3_decoder_select="h263_decoder"
|
||||
msmpeg4v3_encoder_select="h263_encoder"
|
||||
mss2_decoder_select="vc1_decoder"
|
||||
nellymoser_decoder_select="mdct sinewin"
|
||||
nellymoser_encoder_select="mdct sinewin"
|
||||
nellymoser_encoder_select="audio_frame_queue mdct sinewin"
|
||||
nuv_decoder_select="lzo"
|
||||
png_decoder_select="zlib"
|
||||
png_encoder_select="zlib"
|
||||
qcelp_decoder_select="lsp"
|
||||
qdm2_decoder_select="mdct rdft mpegaudiodsp"
|
||||
ra_144_encoder_select="lpc"
|
||||
ra_144_encoder_select="audio_frame_queue lpc"
|
||||
ralf_decoder_select="golomb"
|
||||
rv10_decoder_select="h263_decoder"
|
||||
rv10_encoder_select="h263_encoder"
|
||||
@@ -1778,14 +1781,15 @@ zmbv_encoder_select="zlib"
|
||||
|
||||
# hardware accelerators
|
||||
crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
|
||||
dxva2_deps="dxva2api_h"
|
||||
vaapi_deps="va_va_h"
|
||||
vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
|
||||
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
|
||||
|
||||
h263_vaapi_hwaccel_select="vaapi h263_decoder"
|
||||
h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
|
||||
h264_dxva2_hwaccel_deps="dxva2api_h"
|
||||
h264_dxva2_hwaccel_select="dxva2 h264_decoder"
|
||||
h264_dxva2_hwaccel_deps="dxva2"
|
||||
h264_dxva2_hwaccel_select="h264_decoder"
|
||||
h264_vaapi_hwaccel_select="vaapi h264_decoder"
|
||||
h264_vda_decoder_select="vda h264_parser h264_decoder"
|
||||
h264_vda_hwaccel_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
|
||||
@@ -1795,8 +1799,8 @@ mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
|
||||
mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
|
||||
mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
|
||||
mpeg2_crystalhd_decoder_select="crystalhd"
|
||||
mpeg2_dxva2_hwaccel_deps="dxva2api_h"
|
||||
mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
|
||||
mpeg2_dxva2_hwaccel_deps="dxva2"
|
||||
mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
|
||||
mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
|
||||
mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
|
||||
mpeg4_crystalhd_decoder_select="crystalhd"
|
||||
@@ -1804,8 +1808,8 @@ mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
|
||||
mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
|
||||
msmpeg4_crystalhd_decoder_select="crystalhd"
|
||||
vc1_crystalhd_decoder_select="crystalhd"
|
||||
vc1_dxva2_hwaccel_deps="dxva2api_h"
|
||||
vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
|
||||
vc1_dxva2_hwaccel_deps="dxva2"
|
||||
vc1_dxva2_hwaccel_select="vc1_decoder"
|
||||
vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
|
||||
vc1_vdpau_decoder_select="vdpau vc1_decoder"
|
||||
wmv3_crystalhd_decoder_select="crystalhd"
|
||||
@@ -1823,7 +1827,9 @@ vc1_parser_select="error_resilience mpegvideo"
|
||||
libaacplus_encoder_deps="libaacplus"
|
||||
libcelt_decoder_deps="libcelt"
|
||||
libfaac_encoder_deps="libfaac"
|
||||
libfaac_encoder_select="audio_frame_queue"
|
||||
libfdk_aac_encoder_deps="libfdk_aac"
|
||||
libfdk_aac_encoder_select="audio_frame_queue"
|
||||
libgsm_decoder_deps="libgsm"
|
||||
libgsm_encoder_deps="libgsm"
|
||||
libgsm_ms_decoder_deps="libgsm"
|
||||
@@ -1832,24 +1838,30 @@ libilbc_decoder_deps="libilbc"
|
||||
libilbc_encoder_deps="libilbc"
|
||||
libmodplug_demuxer_deps="libmodplug"
|
||||
libmp3lame_encoder_deps="libmp3lame"
|
||||
libmp3lame_encoder_select="audio_frame_queue"
|
||||
libopencore_amrnb_decoder_deps="libopencore_amrnb"
|
||||
libopencore_amrnb_encoder_deps="libopencore_amrnb"
|
||||
libopencore_amrnb_encoder_select="audio_frame_queue"
|
||||
libopencore_amrwb_decoder_deps="libopencore_amrwb"
|
||||
libopenjpeg_decoder_deps="libopenjpeg"
|
||||
libopenjpeg_encoder_deps="libopenjpeg"
|
||||
libopus_decoder_deps="libopus"
|
||||
libopus_encoder_deps="libopus"
|
||||
libopus_encoder_select="audio_frame_queue"
|
||||
libschroedinger_decoder_deps="libschroedinger"
|
||||
libschroedinger_encoder_deps="libschroedinger"
|
||||
libspeex_decoder_deps="libspeex"
|
||||
libspeex_encoder_deps="libspeex"
|
||||
libspeex_encoder_select="audio_frame_queue"
|
||||
libstagefright_h264_decoder_deps="libstagefright_h264"
|
||||
libtheora_encoder_deps="libtheora"
|
||||
libtwolame_encoder_deps="libtwolame"
|
||||
libvo_aacenc_encoder_deps="libvo_aacenc"
|
||||
libvo_aacenc_encoder_select="audio_frame_queue"
|
||||
libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
|
||||
libvorbis_decoder_deps="libvorbis"
|
||||
libvorbis_encoder_deps="libvorbis"
|
||||
libvorbis_encoder_select="audio_frame_queue"
|
||||
libvpx_decoder_deps="libvpx"
|
||||
libvpx_encoder_deps="libvpx"
|
||||
libx264_encoder_deps="libx264"
|
||||
@@ -2088,6 +2100,9 @@ enable safe_bitstream_reader
|
||||
enable static
|
||||
enable swscale_alpha
|
||||
|
||||
# By default, enable only those hwaccels that have no external dependencies.
|
||||
enable dxva2 vdpau
|
||||
|
||||
# build settings
|
||||
SHFLAGS='-shared -Wl,-soname,$$(@F)'
|
||||
FFSERVERLDFLAGS=-Wl,-E
|
||||
@@ -3076,7 +3091,7 @@ check_64bit(){
|
||||
}
|
||||
|
||||
case "$arch" in
|
||||
alpha|ia64)
|
||||
aarch64|alpha|ia64)
|
||||
spic=$shared
|
||||
;;
|
||||
mips)
|
||||
@@ -3817,7 +3832,6 @@ enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_c
|
||||
enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
|
||||
enabled libass && require_pkg_config libass ass/ass.h ass_library_init
|
||||
enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
|
||||
enabled libcdio && require2 libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio
|
||||
enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
|
||||
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
|
||||
die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
|
||||
@@ -3916,7 +3930,7 @@ rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || d
|
||||
check_header linux/fb.h
|
||||
check_header linux/videodev.h
|
||||
check_header linux/videodev2.h
|
||||
check_struct linux/videodev2.h "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
|
||||
|
||||
@@ -3954,6 +3968,9 @@ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_fu
|
||||
|
||||
enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
|
||||
|
||||
if enabled libcdio; then
|
||||
check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio
|
||||
fi
|
||||
|
||||
enabled x11grab &&
|
||||
require X11 X11/Xlib.h XOpenDisplay -lX11 &&
|
||||
@@ -4090,6 +4107,7 @@ elif enabled gcc; then
|
||||
check_optflags -fno-tree-vectorize
|
||||
check_cflags -Werror=implicit-function-declaration
|
||||
check_cflags -Werror=missing-prototypes
|
||||
check_cflags -Werror=return-type
|
||||
check_cflags -Werror=vla
|
||||
elif enabled llvm_gcc; then
|
||||
check_cflags -mllvm -stack-alignment=16
|
||||
@@ -4098,6 +4116,7 @@ elif enabled clang; then
|
||||
check_cflags -Qunused-arguments
|
||||
check_cflags -Werror=implicit-function-declaration
|
||||
check_cflags -Werror=missing-prototypes
|
||||
check_cflags -Werror=return-type
|
||||
elif enabled armcc; then
|
||||
# 2523: use of inline assembler is deprecated
|
||||
add_cflags -W${armcc_opt},--diag_suppress=2523
|
||||
|
336
doc/APIchanges
336
doc/APIchanges
@@ -132,30 +132,30 @@ API changes, most recent first:
|
||||
2012-03-26 - a67d9cf - lavfi 2.66.100
|
||||
Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
|
||||
|
||||
2012-xx-xx - xxxxxxx - lavu 52.2.1 - avstring.h
|
||||
2012-12-29 - 2ce43b3 / d8fd06c - lavu 52.13.100 / 52.3.0 - avstring.h
|
||||
Add av_basename() and av_dirname().
|
||||
|
||||
2012-11-10 - 5980f5dd - lavu 52.2.0 - audioconvert.h
|
||||
2012-11-11 - 03b0787 / 5980f5d - lavu 52.6.100 / 52.2.0 - audioconvert.h
|
||||
Rename audioconvert.h to channel_layout.h. audioconvert.h is now deprecated.
|
||||
|
||||
2012-10-26 - dfde8a34 - lavu 52.1.0 - intmath.h
|
||||
Add av_ctz() for trailing zero bit count.
|
||||
2012-11-05 - 7d26be6 / dfde8a3 - lavu 52.5.100 / 52.1.0 - intmath.h
|
||||
Add av_ctz() for trailing zero bit count
|
||||
|
||||
2012-10-18 - a893655b - lavu 51.45.0 - error.h
|
||||
Add AVERROR_EXPERIMENTAL.
|
||||
2012-10-21 - e3a91c5 / a893655 - lavu 51.77.100 / 51.45.0 - error.h
|
||||
Add AVERROR_EXPERIMENTAL
|
||||
|
||||
2012-10-12 - d2fcb356 - lavu 51.44.0 - pixdesc.h
|
||||
2012-10-12 - a33ed6b / d2fcb35 - lavu 51.76.100 / 51.44.0 - pixdesc.h
|
||||
Add functions for accessing pixel format descriptors.
|
||||
Accessing the av_pix_fmt_descriptors array directly is now
|
||||
deprecated.
|
||||
|
||||
2012-10-11 - 9a92aea2 - lavu 51.43.0 - aes.h, md5.h, sha.h, tree.h
|
||||
2012-10-11 - f391e40 / 9a92aea - lavu 51.75.100 / 51.43.0 - aes.h, md5.h, sha.h, tree.h
|
||||
Add functions for allocating the opaque contexts for the algorithms,
|
||||
|
||||
2012-10-10 - b522000e - lavf 54.18.0 - avio.h
|
||||
2012-10-10 - de31814 / b522000 - lavf 54.32.100 / 54.18.0 - avio.h
|
||||
Add avio_closep to complement avio_close.
|
||||
|
||||
2012-10-06 - 78071a14 - lavu 51.42.0 - pixfmt.h
|
||||
2012-10-08 - ae77266 / 78071a1 - lavu 51.74.100 / 51.42.0 - pixfmt.h
|
||||
Rename PixelFormat to AVPixelFormat and all PIX_FMT_* to AV_PIX_FMT_*.
|
||||
To provide backwards compatibility, PixelFormat is now #defined as
|
||||
AVPixelFormat.
|
||||
@@ -163,23 +163,23 @@ API changes, most recent first:
|
||||
'PixelFormat' identifier. Such code should either #undef PixelFormat
|
||||
or stop using the PixelFormat name.
|
||||
|
||||
2012-10-05 - e7ba5b1 - lavr 1.0.0 - avresample.h
|
||||
2012-10-05 - 55c49af / e7ba5b1 - lavr 1.0.0 - avresample.h
|
||||
Data planes parameters to avresample_convert() and
|
||||
avresample_read() are now uint8_t** instead of void**.
|
||||
Libavresample is now stable.
|
||||
|
||||
2012-09-24 - a42aada - lavc 54.28.0 - avcodec.h
|
||||
2012-09-24 - 46a3595 / a42aada - lavc 54.59.100 / 54.28.0 - avcodec.h
|
||||
Add avcodec_free_frame(). This function must now
|
||||
be used for freeing an AVFrame.
|
||||
|
||||
2012-09-12 - 8919fee - lavu 51.41.0 - audioconvert.h
|
||||
2012-09-12 - e3e09f2 / 8919fee - lavu 51.73.100 / 51.41.0 - audioconvert.h
|
||||
Added AV_CH_LOW_FREQUENCY_2 channel mask value.
|
||||
|
||||
2012-09-04 - 686a329 - lavu 51.40.0 - opt.h
|
||||
2012-09-04 - b21b5b0 / 686a329 - lavu 51.71.100 / 51.40.0 - opt.h
|
||||
Reordered the fields in default_val in AVOption, changed which
|
||||
default_val field is used for which AVOptionType.
|
||||
|
||||
2012-08-30 - a231832 - lavc 54.26.1 - avcodec.h
|
||||
2012-08-30 - 98298eb / a231832 - lavc 54.54.101 / 54.26.1 - avcodec.h
|
||||
Add codec descriptor properties AV_CODEC_PROP_LOSSY and
|
||||
AV_CODEC_PROP_LOSSLESS.
|
||||
|
||||
@@ -187,90 +187,90 @@ API changes, most recent first:
|
||||
Add codec descriptors for accessing codec properties without having
|
||||
to refer to a specific decoder or encoder.
|
||||
|
||||
c223d79 - Add an AVCodecDescriptor struct and functions
|
||||
f5f3684 / c223d79 - Add an AVCodecDescriptor struct and functions
|
||||
avcodec_descriptor_get() and avcodec_descriptor_next().
|
||||
51efed1 - Add AVCodecDescriptor.props and AV_CODEC_PROP_INTRA_ONLY.
|
||||
91e59fe - Add avcodec_descriptor_get_by_name().
|
||||
f5f3684 / 51efed1 - Add AVCodecDescriptor.props and AV_CODEC_PROP_INTRA_ONLY.
|
||||
6c180b3 / 91e59fe - Add avcodec_descriptor_get_by_name().
|
||||
|
||||
2012-08-08 - 987170c - lavu 51.38 - dict.h
|
||||
2012-08-08 - f5f3684 / 987170c - lavu 51.68.100 / 51.38.0 - dict.h
|
||||
Add av_dict_count().
|
||||
|
||||
2012-08-07 - 104e10f - lavc 54.25 - avcodec.h
|
||||
2012-08-07 - 7a72695 / 104e10f - lavc 54.51.100 / 54.25.0 - avcodec.h
|
||||
Rename CodecID to AVCodecID and all CODEC_ID_* to AV_CODEC_ID_*.
|
||||
To provide backwards compatibility, CodecID is now #defined as AVCodecID.
|
||||
Note that this can break user code that includes avcodec.h and uses the
|
||||
'CodecID' identifier. Such code should either #undef CodecID or stop using the
|
||||
CodecID name.
|
||||
|
||||
2012-08-03 - 239fdf1 - lavu 51.37.1 - cpu.h
|
||||
2012-08-03 - e776ee8 / 239fdf1 - lavu 51.66.101 / 51.37.1 - cpu.h
|
||||
lsws 2.1.1 - swscale.h
|
||||
Rename AV_CPU_FLAG_MMX2 ---> AV_CPU_FLAG_MMXEXT.
|
||||
Rename SWS_CPU_CAPS_MMX2 ---> SWS_CPU_CAPS_MMXEXT.
|
||||
|
||||
2012-07-29 - 681ed00 - lavf 54.13.0 - avformat.h
|
||||
2012-07-29 - 7c26761 / 681ed00 - lavf 54.22.100 / 54.13.0 - avformat.h
|
||||
Add AVFMT_FLAG_NOBUFFER for low latency use cases.
|
||||
|
||||
2012-07-10 - 5fade8a - lavu 51.37.0
|
||||
Add av_malloc_array() and av_mallocz_array()
|
||||
|
||||
2012-06-22 - d3d3a32 - lavu 51.34.0
|
||||
2012-06-22 - e847f41 / d3d3a32 - lavu 51.61.100 / 51.34.0
|
||||
Add av_usleep()
|
||||
|
||||
2012-06-20 - ae0a301 - lavu 51.33.0
|
||||
2012-06-20 - 4da42eb / ae0a301 - lavu 51.60.100 / 51.33.0
|
||||
Move av_gettime() to libavutil, add libavutil/time.h
|
||||
|
||||
2012-06-09 - 3971be0 - lavr 0.0.3
|
||||
2012-06-09 - 82edf67 / 3971be0 - lavr 0.0.3
|
||||
Add a parameter to avresample_build_matrix() for Dolby/DPLII downmixing.
|
||||
|
||||
2012-06-12 - 9baeff9 - lavfi 2.23.0 - avfilter.h
|
||||
2012-06-12 - c7b9eab / 9baeff9 - lavfi 2.79.100 / 2.23.0 - avfilter.h
|
||||
Add AVFilterContext.nb_inputs/outputs. Deprecate
|
||||
AVFilterContext.input/output_count.
|
||||
|
||||
2012-06-12 - 84b9fbe - lavfi 2.22.0 - avfilter.h
|
||||
2012-06-12 - c7b9eab / 84b9fbe - lavfi 2.79.100 / 2.22.0 - avfilter.h
|
||||
Add avfilter_pad_get_type() and avfilter_pad_get_name(). Those
|
||||
should now be used instead of accessing AVFilterPad members
|
||||
directly.
|
||||
|
||||
2012-06-12 - b0f0dfc - lavu 51.32.0 - audioconvert.h
|
||||
2012-06-12 - 3630a07 / b0f0dfc - lavu 51.57.100 / 51.32.0 - audioconvert.h
|
||||
Add av_get_channel_layout_channel_index(), av_get_channel_name()
|
||||
and av_channel_layout_extract_channel().
|
||||
|
||||
2012-05-25 - 154486f - lavu 51.31.0 - opt.h
|
||||
2012-05-25 - 53ce990 / 154486f - lavu 51.55.100 / 51.31.0 - opt.h
|
||||
Add av_opt_set_bin()
|
||||
|
||||
2012-05-15 - lavfi 2.17.0
|
||||
2012-05-15 - lavfi 2.74.100 / 2.17.0
|
||||
Add support for audio filters
|
||||
ac71230/a2cd9be - add video/audio buffer sink in a new installed
|
||||
61930bd / ac71230, 1cbf7fb / a2cd9be - add video/audio buffer sink in a new installed
|
||||
header buffersink.h
|
||||
720c6b7 - add av_buffersrc_write_frame(), deprecate
|
||||
1cbf7fb / 720c6b7 - add av_buffersrc_write_frame(), deprecate
|
||||
av_vsrc_buffer_add_frame()
|
||||
ab16504 - add avfilter_copy_buf_props()
|
||||
9453c9e - add extended_data to AVFilterBuffer
|
||||
1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays()
|
||||
61930bd / ab16504 - add avfilter_copy_buf_props()
|
||||
61930bd / 9453c9e - add extended_data to AVFilterBuffer
|
||||
61930bd / 1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays()
|
||||
|
||||
2012-05-09 - lavu 51.30.0 - samplefmt.h
|
||||
142e740 - add av_samples_copy()
|
||||
6d7f617 - add av_samples_set_silence()
|
||||
2012-05-09 - lavu 51.53.100 / 51.30.0 - samplefmt.h
|
||||
61930bd / 142e740 - add av_samples_copy()
|
||||
61930bd / 6d7f617 - add av_samples_set_silence()
|
||||
|
||||
2012-05-09 - a5117a2 - lavc 54.13.1
|
||||
2012-05-09 - 61930bd / a5117a2 - lavc 54.21.101 / 54.13.1
|
||||
For audio formats with fixed frame size, the last frame
|
||||
no longer needs to be padded with silence, libavcodec
|
||||
will handle this internally (effectively all encoders
|
||||
behave as if they had CODEC_CAP_SMALL_LAST_FRAME set).
|
||||
|
||||
2012-05-07 - 828bd08 - lavc 54.13.0 - avcodec.h
|
||||
2012-05-07 - 653d117 / 828bd08 - lavc 54.20.100 / 54.13.0 - avcodec.h
|
||||
Add sample_rate and channel_layout fields to AVFrame.
|
||||
|
||||
2012-05-01 - 4010d72 - lavr 0.0.1
|
||||
2012-05-01 - 2330eb1 / 4010d72 - lavr 0.0.1
|
||||
Change AV_MIX_COEFF_TYPE_Q6 to AV_MIX_COEFF_TYPE_Q8.
|
||||
|
||||
2012-04-25 - 3527a73 - lavu 51.29.0 - cpu.h
|
||||
2012-04-25 - e890b68 / 3527a73 - lavu 51.48.100 / 51.29.0 - cpu.h
|
||||
Add av_parse_cpu_flags()
|
||||
|
||||
2012-04-24 - c8af852 - lavr 0.0.0
|
||||
2012-04-24 - 3ead79e / c8af852 - lavr 0.0.0
|
||||
Add libavresample audio conversion library
|
||||
|
||||
2012-04-20 - 0c0d1bc - lavu 51.28.0 - audio_fifo.h
|
||||
2012-04-20 - 3194ab7 / 0c0d1bc - lavu 51.47.100 / 51.28.0 - audio_fifo.h
|
||||
Add audio FIFO functions:
|
||||
av_audio_fifo_free()
|
||||
av_audio_fifo_alloc()
|
||||
@@ -282,10 +282,10 @@ API changes, most recent first:
|
||||
av_audio_fifo_size()
|
||||
av_audio_fifo_space()
|
||||
|
||||
2012-04-14 - lavfi 2.16.0 - avfiltergraph.h
|
||||
d7bcc71 Add avfilter_graph_parse2().
|
||||
2012-04-14 - lavfi 2.70.100 / 2.16.0 - avfiltergraph.h
|
||||
7432bcf / d7bcc71 Add avfilter_graph_parse2().
|
||||
|
||||
2012-04-08 - 4d693b0 - lavu 51.27.0 - samplefmt.h
|
||||
2012-04-08 - 6bfb304 / 4d693b0 - lavu 51.46.100 / 51.27.0 - samplefmt.h
|
||||
Add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()
|
||||
|
||||
2012-03-21 - b75c67d - lavu 51.43.100
|
||||
@@ -313,73 +313,73 @@ API changes, most recent first:
|
||||
2012-01-24 - 0c3577b - lavfi 2.60.100
|
||||
Add avfilter_graph_dump.
|
||||
|
||||
2012-03-20 - 3c90cc2 - lavfo 54.2.0
|
||||
2012-03-20 - 0ebd836 / 3c90cc2 - lavfo 54.2.0
|
||||
Deprecate av_read_packet(), use av_read_frame() with
|
||||
AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN in AVFormatContext.flags
|
||||
|
||||
2012-03-05 - lavc 54.8.0
|
||||
6699d07 Add av_get_exact_bits_per_sample()
|
||||
9524cf7 Add av_get_audio_frame_duration()
|
||||
2012-03-05 - lavc 54.10.100 / 54.8.0
|
||||
f095391 / 6699d07 Add av_get_exact_bits_per_sample()
|
||||
f095391 / 9524cf7 Add av_get_audio_frame_duration()
|
||||
|
||||
2012-03-04 - 44fe77b - lavc 54.7.0 - avcodec.h
|
||||
2012-03-04 - 2af8f2c / 44fe77b - lavc 54.8.100 / 54.7.0 - avcodec.h
|
||||
Add av_codec_is_encoder/decoder().
|
||||
|
||||
2012-03-01 - 442c132 - lavc 54.3.0 - avcodec.h
|
||||
2012-03-01 - 1eb7f39 / 442c132 - lavc 54.5.100 / 54.3.0 - avcodec.h
|
||||
Add av_packet_shrink_side_data.
|
||||
|
||||
2012-02-29 - dd2a4bc - lavf 54.2.0 - avformat.h
|
||||
2012-02-29 - 79ae084 / dd2a4bc - lavf 54.2.100 / 54.2.0 - avformat.h
|
||||
Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC,
|
||||
used for dealing with attached pictures/cover art.
|
||||
|
||||
2012-02-25 - c9bca80 - lavu 51.24.0 - error.h
|
||||
2012-02-25 - 305e4b3 / c9bca80 - lavu 51.41.100 / 51.24.0 - error.h
|
||||
Add AVERROR_UNKNOWN
|
||||
NOTE: this was backported to 0.8
|
||||
|
||||
2012-02-20 - e9cda85 - lavc 54.2.0
|
||||
2012-02-20 - eadd426 / e9cda85 - lavc 54.2.100 / 54.2.0
|
||||
Add duration field to AVCodecParserContext
|
||||
|
||||
2012-02-20 - 0b42a93 - lavu 51.23.1 - mathematics.h
|
||||
2012-02-20 - eadd426 / 0b42a93 - lavu 51.40.100 / 51.23.1 - mathematics.h
|
||||
Add av_rescale_q_rnd()
|
||||
|
||||
2012-02-08 - 38d5533 - lavu 51.22.1 - pixdesc.h
|
||||
2012-02-08 - f2b20b7 / 38d5533 - lavu 51.38.101 / 51.22.1 - pixdesc.h
|
||||
Add PIX_FMT_PSEUDOPAL flag.
|
||||
|
||||
2012-02-08 - 52f82a1 - lavc 54.01.0
|
||||
2012-02-08 - f2b20b7 / 52f82a1 - lavc 54.2.100 / 54.1.0
|
||||
Add avcodec_encode_video2() and deprecate avcodec_encode_video().
|
||||
|
||||
2012-02-01 - 316fc74 - lavc 54.01.0
|
||||
2012-02-01 - 4c677df / 316fc74 - lavc 54.1.0
|
||||
Add av_fast_padded_malloc() as alternative for av_realloc() when aligned
|
||||
memory is required. The buffer will always have FF_INPUT_BUFFER_PADDING_SIZE
|
||||
zero-padded bytes at the end.
|
||||
|
||||
2012-01-31 - dd6d3b0 - lavf 54.01.0
|
||||
2012-01-31 - a369a6b / dd6d3b0 - lavf 54.1.0
|
||||
Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
|
||||
NOTE: this was backported to 0.8
|
||||
|
||||
2012-01-31 - af08d9a - lavc 54.01.0
|
||||
2012-01-31 - a369a6b / af08d9a - lavc 54.1.0
|
||||
Add avcodec_is_open() function.
|
||||
NOTE: this was backported to 0.8
|
||||
|
||||
2012-01-30 - 8b93312 - lavu 51.22.0 - intfloat.h
|
||||
2012-01-30 - 151ecc2 / 8b93312 - lavu 51.36.100 / 51.22.0 - intfloat.h
|
||||
Add a new installed header libavutil/intfloat.h with int/float punning
|
||||
functions.
|
||||
NOTE: this was backported to 0.8
|
||||
|
||||
2012-01-25 - lavf 53.22.0
|
||||
f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
|
||||
2012-01-25 - lavf 53.31.100 / 53.22.0
|
||||
3c5fe5b / f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
|
||||
buffered data within a muxer. Added AVFMT_ALLOW_FLUSH for
|
||||
muxers supporting it (av_write_frame makes sure it is called
|
||||
only for muxers with this flag).
|
||||
|
||||
2012-01-15 - lavc 53.34.0
|
||||
2012-01-15 - lavc 53.56.105 / 53.34.0
|
||||
New audio encoding API:
|
||||
b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
|
||||
67f5650 / b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
|
||||
encoders.
|
||||
5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
|
||||
b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
|
||||
67f5650 / 5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
|
||||
67f5650 / b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
|
||||
Add AVCodec.encode2().
|
||||
|
||||
2012-01-12 - 3167dc9 - lavfi 2.15.0
|
||||
2012-01-12 - b18e17e / 3167dc9 - lavfi 2.59.100 / 2.15.0
|
||||
Add a new installed header -- libavfilter/version.h -- with version macros.
|
||||
|
||||
2011-12-08 - a502939 - lavfi 2.52.0
|
||||
@@ -400,37 +400,37 @@ API changes, most recent first:
|
||||
2011-10-20 - b35e9e1 - lavu 51.22.0
|
||||
Add av_strtok() to avstring.h.
|
||||
|
||||
2011-01-03 - b73ec05 - lavu 51.21.0
|
||||
2012-01-03 - ad1c8dd / b73ec05 - lavu 51.34.100 / 51.21.0
|
||||
Add av_popcount64
|
||||
|
||||
2011-12-18 - 8400b12 - lavc 53.28.1
|
||||
2011-12-18 - 7c29313 / 8400b12 - lavc 53.46.1 / 53.28.1
|
||||
Deprecate AVFrame.age. The field is unused.
|
||||
|
||||
2011-12-12 - 5266045 - lavf 53.17.0
|
||||
2011-12-12 - 8bc7fe4 / 5266045 - lavf 53.25.0 / 53.17.0
|
||||
Add avformat_close_input().
|
||||
Deprecate av_close_input_file() and av_close_input_stream().
|
||||
|
||||
2011-12-02 - 0eea212 - lavc 53.25.0
|
||||
2011-12-02 - e4de716 / 0eea212 - lavc 53.40.0 / 53.25.0
|
||||
Add nb_samples and extended_data fields to AVFrame.
|
||||
Deprecate AVCODEC_MAX_AUDIO_FRAME_SIZE.
|
||||
Deprecate avcodec_decode_audio3() in favor of avcodec_decode_audio4().
|
||||
avcodec_decode_audio4() writes output samples to an AVFrame, which allows
|
||||
audio decoders to use get_buffer().
|
||||
|
||||
2011-12-04 - 560f773 - lavc 53.24.0
|
||||
2011-12-04 - e4de716 / 560f773 - lavc 53.40.0 / 53.24.0
|
||||
Change AVFrame.data[4]/base[4]/linesize[4]/error[4] to [8] at next major bump.
|
||||
Change AVPicture.data[4]/linesize[4] to [8] at next major bump.
|
||||
Change AVCodecContext.error[4] to [8] at next major bump.
|
||||
Add AV_NUM_DATA_POINTERS to simplify the bump transition.
|
||||
|
||||
2011-11-23 - bbb46f3 - lavu 51.18.0
|
||||
2011-11-23 - 8e576d5 / bbb46f3 - lavu 51.27.0 / 51.18.0
|
||||
Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and
|
||||
av_samples_alloc(), to samplefmt.h.
|
||||
|
||||
2011-11-23 - 8889cc4 - lavu 51.17.0
|
||||
2011-11-23 - 8e576d5 / 8889cc4 - lavu 51.27.0 / 51.17.0
|
||||
Add planar sample formats and av_sample_fmt_is_planar() to samplefmt.h.
|
||||
|
||||
2011-11-19 - f3a29b7 - lavc 53.21.0
|
||||
2011-11-19 - dbb38bc / f3a29b7 - lavc 53.36.0 / 53.21.0
|
||||
Move some AVCodecContext fields to a new private struct, AVCodecInternal,
|
||||
which is accessed from a new field, AVCodecContext.internal.
|
||||
- fields moved:
|
||||
@@ -438,55 +438,55 @@ API changes, most recent first:
|
||||
AVCodecContext.internal_buffer_count --> AVCodecInternal.buffer_count
|
||||
AVCodecContext.is_copy --> AVCodecInternal.is_copy
|
||||
|
||||
2011-11-16 - 6270671 - lavu 51.16.0
|
||||
2011-11-16 - 8709ba9 / 6270671 - lavu 51.26.0 / 51.16.0
|
||||
Add av_timegm()
|
||||
|
||||
2011-11-13 - lavf 53.15.0
|
||||
2011-11-13 - lavf 53.21.0 / 53.15.0
|
||||
New interrupt callback API, allowing per-AVFormatContext/AVIOContext
|
||||
interrupt callbacks.
|
||||
6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
|
||||
5f268ca / 6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
|
||||
AVFormatContext.
|
||||
1dee0ac Add avio_open2() with additional parameters. Those are
|
||||
5f268ca / 1dee0ac Add avio_open2() with additional parameters. Those are
|
||||
an interrupt callback and an options AVDictionary.
|
||||
This will allow passing AVOptions to protocols after lavf
|
||||
54.0.
|
||||
|
||||
2011-11-06 - ba04ecf - lavu 51.14.0
|
||||
2011-11-06 - 13b7781 / ba04ecf - lavu 51.24.0 / 51.14.0
|
||||
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
|
||||
|
||||
2011-11-06 - 07b172f - lavu 51.13.0
|
||||
2011-11-06 - 13b7781 / 07b172f - lavu 51.24.0 / 51.13.0
|
||||
Add av_toupper()/av_tolower()
|
||||
|
||||
2011-11-05 - b6d08f4 - lavf 53.13.0
|
||||
2011-11-05 - d8cab5c / b6d08f4 - lavf 53.19.0 / 53.13.0
|
||||
Add avformat_network_init()/avformat_network_deinit()
|
||||
|
||||
2011-10-27 - 512557b - lavc 53.15.0
|
||||
2011-10-27 - 6faf0a2 / 512557b - lavc 53.24.0 / 53.15.0
|
||||
Remove avcodec_parse_frame.
|
||||
Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY.
|
||||
|
||||
2011-10-19 - 569129a - lavf 53.10.0
|
||||
2011-10-19 - d049257 / 569129a - lavf 53.17.0 / 53.10.0
|
||||
Add avformat_new_stream(). Deprecate av_new_stream().
|
||||
|
||||
2011-10-13 - b631fba - lavf 53.9.0
|
||||
2011-10-13 - 91eb1b1 / b631fba - lavf 53.16.0 / 53.9.0
|
||||
Add AVFMT_NO_BYTE_SEEK AVInputFormat flag.
|
||||
|
||||
2011-10-12 - lavu 51.12.0
|
||||
2011-10-12 - lavu 51.21.0 / 51.12.0
|
||||
AVOptions API rewrite.
|
||||
|
||||
- 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
|
||||
- f884ef0 / 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
|
||||
- new setting/getting functions with slightly different semantics:
|
||||
dac66da av_set_string3 -> av_opt_set
|
||||
f884ef0 / dac66da av_set_string3 -> av_opt_set
|
||||
av_set_double -> av_opt_set_double
|
||||
av_set_q -> av_opt_set_q
|
||||
av_set_int -> av_opt_set_int
|
||||
|
||||
41d9d51 av_get_string -> av_opt_get
|
||||
f884ef0 / 41d9d51 av_get_string -> av_opt_get
|
||||
av_get_double -> av_opt_get_double
|
||||
av_get_q -> av_opt_get_q
|
||||
av_get_int -> av_opt_get_int
|
||||
|
||||
- 8c5dcaa trivial rename av_next_option -> av_opt_next
|
||||
- 641c7af new functions - av_opt_child_next, av_opt_child_class_next
|
||||
- f884ef0 / 8c5dcaa trivial rename av_next_option -> av_opt_next
|
||||
- f884ef0 / 641c7af new functions - av_opt_child_next, av_opt_child_class_next
|
||||
and av_opt_find2()
|
||||
|
||||
2011-09-22 - a70e787 - lavu 51.17.0
|
||||
@@ -532,31 +532,31 @@ API changes, most recent first:
|
||||
2011-08-20 - 69e2c1a - lavu 51.13.0
|
||||
Add av_get_media_type_string().
|
||||
|
||||
2011-09-03 - fb4ca26 - lavc 53.13.0
|
||||
2011-09-03 - 1889c67 / fb4ca26 - lavc 53.13.0
|
||||
lavf 53.11.0
|
||||
lsws 2.1.0
|
||||
Add {avcodec,avformat,sws}_get_class().
|
||||
|
||||
2011-08-03 - c11fb82 - lavu 51.15.0
|
||||
2011-08-03 - 1889c67 / c11fb82 - lavu 51.15.0
|
||||
Add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find() function.
|
||||
|
||||
2011-08-14 - 323b930 - lavu 51.12.0
|
||||
Add av_fifo_peek2(), deprecate av_fifo_peek().
|
||||
|
||||
2011-08-26 - lavu 51.9.0
|
||||
- add41de..abc78a5 Do not include intfloat_readwrite.h,
|
||||
2011-08-26 - lavu 51.14.0 / 51.9.0
|
||||
- 976a8b2 / add41de..976a8b2 / abc78a5 Do not include intfloat_readwrite.h,
|
||||
mathematics.h, rational.h, pixfmt.h, or log.h from avutil.h.
|
||||
|
||||
2011-08-16 - 48f9e45 - lavf 53.8.0
|
||||
2011-08-16 - 27fbe31 / 48f9e45 - lavf 53.11.0 / 53.8.0
|
||||
Add avformat_query_codec().
|
||||
|
||||
2011-08-16 - bca06e7 - lavc 53.11.0
|
||||
2011-08-16 - 27fbe31 / bca06e7 - lavc 53.11.0
|
||||
Add avcodec_get_type().
|
||||
|
||||
2011-08-06 - 2f63440 - lavf 53.7.0
|
||||
2011-08-06 - 0cb233c / 2f63440 - lavf 53.7.0
|
||||
Add error_recognition to AVFormatContext.
|
||||
|
||||
2011-08-02 - 9d39cbf - lavc 53.9.1
|
||||
2011-08-02 - 1d186e9 / 9d39cbf - lavc 53.9.1
|
||||
Add AV_PKT_FLAG_CORRUPT AVPacket flag.
|
||||
|
||||
2011-07-16 - b57df29 - lavfi 2.27.0
|
||||
@@ -567,11 +567,11 @@ API changes, most recent first:
|
||||
avfilter_set_common_packing_formats()
|
||||
avfilter_all_packing_formats()
|
||||
|
||||
2011-07-10 - a67c061 - lavf 53.6.0
|
||||
2011-07-10 - 3602ad7 / a67c061 - lavf 53.6.0
|
||||
Add avformat_find_stream_info(), deprecate av_find_stream_info().
|
||||
NOTE: this was backported to 0.7
|
||||
|
||||
2011-07-10 - 0b950fe - lavc 53.8.0
|
||||
2011-07-10 - 3602ad7 / 0b950fe - lavc 53.8.0
|
||||
Add avcodec_open2(), deprecate avcodec_open().
|
||||
NOTE: this was backported to 0.7
|
||||
|
||||
@@ -614,35 +614,35 @@ API changes, most recent first:
|
||||
2011-06-12 - 6119b23 - lavfi 2.16.0 - avfilter_graph_parse()
|
||||
Change avfilter_graph_parse() signature.
|
||||
|
||||
2011-06-23 - 67e9ae1 - lavu 51.8.0 - attributes.h
|
||||
2011-06-23 - 686959e / 67e9ae1 - lavu 51.10.0 / 51.8.0 - attributes.h
|
||||
Add av_printf_format().
|
||||
|
||||
2011-06-16 - 05e84c9, 25de595 - lavf 53.2.0 - avformat.h
|
||||
2011-06-16 - 2905e3f / 05e84c9, 2905e3f / 25de595 - lavf 53.4.0 / 53.2.0 - avformat.h
|
||||
Add avformat_open_input and avformat_write_header().
|
||||
Deprecate av_open_input_stream, av_open_input_file,
|
||||
AVFormatParameters and av_write_header.
|
||||
|
||||
2011-06-16 - 7e83e1c, dc59ec5 - lavu 51.7.0 - opt.h
|
||||
2011-06-16 - 2905e3f / 7e83e1c, 2905e3f / dc59ec5 - lavu 51.9.0 / 51.7.0 - opt.h
|
||||
Add av_opt_set_dict() and av_opt_find().
|
||||
Deprecate av_find_opt().
|
||||
Add AV_DICT_APPEND flag.
|
||||
|
||||
2011-06-10 - cb7c11c - lavu 51.6.0 - opt.h
|
||||
2011-06-10 - 45fb647 / cb7c11c - lavu 51.6.0 - opt.h
|
||||
Add av_opt_flag_is_set().
|
||||
|
||||
2011-06-10 - c381960 - lavfi 2.15.0 - avfilter_get_audio_buffer_ref_from_arrays
|
||||
Add avfilter_get_audio_buffer_ref_from_arrays() to avfilter.h.
|
||||
|
||||
2011-06-09 - d9f80ea - lavu 51.8.0 - AVMetadata
|
||||
2011-06-09 - f9ecb84 / d9f80ea - lavu 51.8.0 - AVMetadata
|
||||
Move AVMetadata from lavf to lavu and rename it to
|
||||
AVDictionary -- new installed header dict.h.
|
||||
All av_metadata_* functions renamed to av_dict_*.
|
||||
|
||||
2011-06-07 - a6703fa - lavu 51.8.0 - av_get_bytes_per_sample()
|
||||
2011-06-07 - d552f61 / a6703fa - lavu 51.8.0 - av_get_bytes_per_sample()
|
||||
Add av_get_bytes_per_sample() in libavutil/samplefmt.h.
|
||||
Deprecate av_get_bits_per_sample_fmt().
|
||||
|
||||
2011-06-05 - b39b062 - lavu 51.8.0 - opt.h
|
||||
2011-06-05 - f956924 / b39b062 - lavu 51.8.0 - opt.h
|
||||
Add av_opt_free convenience function.
|
||||
|
||||
2011-06-06 - 95a0242 - lavfi 2.14.0 - AVFilterBufferRefAudioProps
|
||||
@@ -672,7 +672,7 @@ API changes, most recent first:
|
||||
Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
|
||||
avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
|
||||
|
||||
2011-05-25 - 30315a8 - lavf 53.3.0 - avformat.h
|
||||
2011-05-25 - 39e4206 / 30315a8 - lavf 53.3.0 - avformat.h
|
||||
Add fps_probe_size to AVFormatContext.
|
||||
|
||||
2011-05-22 - 5ecdfd0 - lavf 53.2.0 - avformat.h
|
||||
@@ -688,10 +688,10 @@ API changes, most recent first:
|
||||
2011-05-14 - 9fdf772 - lavfi 2.6.0 - avcodec.h
|
||||
Add avfilter_get_video_buffer_ref_from_frame() to libavfilter/avcodec.h.
|
||||
|
||||
2011-05-18 - 64150ff - lavc 53.7.0 - AVCodecContext.request_sample_fmt
|
||||
2011-05-18 - 75a37b5 / 64150ff - lavc 53.7.0 - AVCodecContext.request_sample_fmt
|
||||
Add request_sample_fmt field to AVCodecContext.
|
||||
|
||||
2011-05-10 - 188dea1 - lavc 53.6.0 - avcodec.h
|
||||
2011-05-10 - 59eb12f / 188dea1 - lavc 53.6.0 - avcodec.h
|
||||
Deprecate AVLPCType and the following fields in
|
||||
AVCodecContext: lpc_coeff_precision, prediction_order_method,
|
||||
min_partition_order, max_partition_order, lpc_type, lpc_passes.
|
||||
@@ -721,81 +721,81 @@ API changes, most recent first:
|
||||
Add av_dynarray_add function for adding
|
||||
an element to a dynamic array.
|
||||
|
||||
2011-04-26 - bebe72f - lavu 51.1.0 - avutil.h
|
||||
2011-04-26 - d7e5aeb / bebe72f - lavu 51.1.0 - avutil.h
|
||||
Add AVPictureType enum and av_get_picture_type_char(), deprecate
|
||||
FF_*_TYPE defines and av_get_pict_type_char() defined in
|
||||
libavcodec/avcodec.h.
|
||||
|
||||
2011-04-26 - 10d3940 - lavfi 2.3.0 - avfilter.h
|
||||
2011-04-26 - d7e5aeb / 10d3940 - lavfi 2.3.0 - avfilter.h
|
||||
Add pict_type and key_frame fields to AVFilterBufferRefVideo.
|
||||
|
||||
2011-04-26 - 7a11c82 - lavfi 2.2.0 - vsrc_buffer
|
||||
2011-04-26 - d7e5aeb / 7a11c82 - lavfi 2.2.0 - vsrc_buffer
|
||||
Add sample_aspect_ratio fields to vsrc_buffer arguments
|
||||
|
||||
2011-04-21 - 94f7451 - lavc 53.1.0 - avcodec.h
|
||||
2011-04-21 - 8772156 / 94f7451 - lavc 53.1.0 - avcodec.h
|
||||
Add CODEC_CAP_SLICE_THREADS for codecs supporting sliced threading.
|
||||
|
||||
2011-04-15 - lavc 52.120.0 - avcodec.h
|
||||
AVPacket structure got additional members for passing side information:
|
||||
4de339e introduce side information for AVPacket
|
||||
2d8591c make containers pass palette change in AVPacket
|
||||
c407984 / 4de339e introduce side information for AVPacket
|
||||
c407984 / 2d8591c make containers pass palette change in AVPacket
|
||||
|
||||
2011-04-12 - lavf 52.107.0 - avio.h
|
||||
Avio cleanup, part II - deprecate the entire URLContext API:
|
||||
175389c add avio_check as a replacement for url_exist
|
||||
ff1ec0c add avio_pause and avio_seek_time as replacements
|
||||
c55780d / 175389c add avio_check as a replacement for url_exist
|
||||
9891004 / ff1ec0c add avio_pause and avio_seek_time as replacements
|
||||
for _av_url_read_fseek/fpause
|
||||
cdc6a87 deprecate av_protocol_next(), avio_enum_protocols
|
||||
d4d0932 / cdc6a87 deprecate av_protocol_next(), avio_enum_protocols
|
||||
should be used instead.
|
||||
80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb.
|
||||
f87b1b3 rename open flags: URL_* -> AVIO_*
|
||||
f8270bb add avio_enum_protocols.
|
||||
5593f03 deprecate URLProtocol.
|
||||
c486dad deprecate URLContext.
|
||||
026e175 deprecate the typedef for URLInterruptCB
|
||||
8e76a19 deprecate av_register_protocol2.
|
||||
b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME
|
||||
1305d93 deprecate av_url_read_seek
|
||||
fa104e1 deprecate av_url_read_pause
|
||||
727c7aa deprecate url_get_filename().
|
||||
5958df3 deprecate url_max_packet_size().
|
||||
1869ea0 deprecate url_get_file_handle().
|
||||
32a97d4 deprecate url_filesize().
|
||||
e52a914 deprecate url_close().
|
||||
58a48c6 deprecate url_seek().
|
||||
925e908 deprecate url_write().
|
||||
dce3756 deprecate url_read_complete().
|
||||
bc371ac deprecate url_read().
|
||||
0589da0 deprecate url_open().
|
||||
62eaaea deprecate url_connect.
|
||||
5652bb9 deprecate url_alloc.
|
||||
333e894 deprecate url_open_protocol
|
||||
e230705 deprecate url_poll and URLPollEntry
|
||||
c88caa5 / 80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb.
|
||||
c88caa5 / f87b1b3 rename open flags: URL_* -> AVIO_*
|
||||
d4d0932 / f8270bb add avio_enum_protocols.
|
||||
d4d0932 / 5593f03 deprecate URLProtocol.
|
||||
d4d0932 / c486dad deprecate URLContext.
|
||||
d4d0932 / 026e175 deprecate the typedef for URLInterruptCB
|
||||
c88caa5 / 8e76a19 deprecate av_register_protocol2.
|
||||
11d7841 / b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME
|
||||
11d7841 / 1305d93 deprecate av_url_read_seek
|
||||
11d7841 / fa104e1 deprecate av_url_read_pause
|
||||
434f248 / 727c7aa deprecate url_get_filename().
|
||||
434f248 / 5958df3 deprecate url_max_packet_size().
|
||||
434f248 / 1869ea0 deprecate url_get_file_handle().
|
||||
434f248 / 32a97d4 deprecate url_filesize().
|
||||
434f248 / e52a914 deprecate url_close().
|
||||
434f248 / 58a48c6 deprecate url_seek().
|
||||
434f248 / 925e908 deprecate url_write().
|
||||
434f248 / dce3756 deprecate url_read_complete().
|
||||
434f248 / bc371ac deprecate url_read().
|
||||
434f248 / 0589da0 deprecate url_open().
|
||||
434f248 / 62eaaea deprecate url_connect.
|
||||
434f248 / 5652bb9 deprecate url_alloc.
|
||||
434f248 / 333e894 deprecate url_open_protocol
|
||||
434f248 / e230705 deprecate url_poll and URLPollEntry
|
||||
|
||||
2011-04-08 - lavf 52.106.0 - avformat.h
|
||||
Minor avformat.h cleanup:
|
||||
a9bf9d8 deprecate av_guess_image2_codec
|
||||
c3675df rename avf_sdp_create->av_sdp_create
|
||||
d4d0932 / a9bf9d8 deprecate av_guess_image2_codec
|
||||
d4d0932 / c3675df rename avf_sdp_create->av_sdp_create
|
||||
|
||||
2011-04-03 - lavf 52.105.0 - avio.h
|
||||
Large-scale renaming/deprecating of AVIOContext-related functions:
|
||||
724f6a0 deprecate url_fdopen
|
||||
403ee83 deprecate url_open_dyn_packet_buf
|
||||
6dc7d80 rename url_close_dyn_buf -> avio_close_dyn_buf
|
||||
b92c545 rename url_open_dyn_buf -> avio_open_dyn_buf
|
||||
8978fed introduce an AVIOContext.seekable field as a replacement for
|
||||
2cae980 / 724f6a0 deprecate url_fdopen
|
||||
2cae980 / 403ee83 deprecate url_open_dyn_packet_buf
|
||||
2cae980 / 6dc7d80 rename url_close_dyn_buf -> avio_close_dyn_buf
|
||||
2cae980 / b92c545 rename url_open_dyn_buf -> avio_open_dyn_buf
|
||||
2cae980 / 8978fed introduce an AVIOContext.seekable field as a replacement for
|
||||
AVIOContext.is_streamed and url_is_streamed()
|
||||
b64030f deprecate get_checksum()
|
||||
4c4427a deprecate init_checksum()
|
||||
4ec153b deprecate udp_set_remote_url/get_local_port
|
||||
933e90a deprecate av_url_read_fseek/fpause
|
||||
8d9769a deprecate url_fileno
|
||||
b7f2fdd rename put_flush_packet -> avio_flush
|
||||
35f1023 deprecate url_close_buf
|
||||
83fddae deprecate url_open_buf
|
||||
d9d86e0 rename url_fprintf -> avio_printf
|
||||
59f65d9 deprecate url_setbufsize
|
||||
3e68b3b deprecate url_ferror
|
||||
1caa412 / b64030f deprecate get_checksum()
|
||||
1caa412 / 4c4427a deprecate init_checksum()
|
||||
2fd41c9 / 4ec153b deprecate udp_set_remote_url/get_local_port
|
||||
4fa0e24 / 933e90a deprecate av_url_read_fseek/fpause
|
||||
4fa0e24 / 8d9769a deprecate url_fileno
|
||||
0fecf26 / b7f2fdd rename put_flush_packet -> avio_flush
|
||||
0fecf26 / 35f1023 deprecate url_close_buf
|
||||
0fecf26 / 83fddae deprecate url_open_buf
|
||||
0fecf26 / d9d86e0 rename url_fprintf -> avio_printf
|
||||
0fecf26 / 59f65d9 deprecate url_setbufsize
|
||||
6947b0c / 3e68b3b deprecate url_ferror
|
||||
e8bb2e2 deprecate url_fget_max_packet_size
|
||||
76aa876 rename url_fsize -> avio_size
|
||||
e519753 deprecate url_fgetc
|
||||
@@ -816,7 +816,7 @@ API changes, most recent first:
|
||||
b3db9ce deprecate get_partial_buffer
|
||||
8d9ac96 rename av_alloc_put_byte -> avio_alloc_context
|
||||
|
||||
2011-03-25 - 34b47d7 - lavc 52.115.0 - AVCodecContext.audio_service_type
|
||||
2011-03-25 - 27ef7b1 / 34b47d7 - lavc 52.115.0 - AVCodecContext.audio_service_type
|
||||
Add audio_service_type field to AVCodecContext.
|
||||
|
||||
2011-03-17 - e309fdc - lavu 50.40.0 - pixfmt.h
|
||||
@@ -854,11 +854,11 @@ API changes, most recent first:
|
||||
2011-02-10 - 12c14cd - lavf 52.99.0 - AVStream.disposition
|
||||
Add AV_DISPOSITION_HEARING_IMPAIRED and AV_DISPOSITION_VISUAL_IMPAIRED.
|
||||
|
||||
2011-02-09 - 5592734 - lavc 52.112.0 - avcodec_thread_init()
|
||||
2011-02-09 - c0b102c - lavc 52.112.0 - avcodec_thread_init()
|
||||
Deprecate avcodec_thread_init()/avcodec_thread_free() use; instead
|
||||
set thread_count before calling avcodec_open.
|
||||
|
||||
2011-02-09 - 778b08a - lavc 52.111.0 - threading API
|
||||
2011-02-09 - 37b00b4 - lavc 52.111.0 - threading API
|
||||
Add CODEC_CAP_FRAME_THREADS with new restrictions on get_buffer()/
|
||||
release_buffer()/draw_horiz_band() callbacks for appropriate codecs.
|
||||
Add thread_type and active_thread_type fields to AVCodecContext.
|
||||
|
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER = 1.1.5
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
@@ -92,9 +92,9 @@ uninstall: uninstall-man
|
||||
uninstall-man:
|
||||
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
|
||||
|
||||
docclean: clean
|
||||
clean:: docclean
|
||||
|
||||
clean::
|
||||
docclean:
|
||||
$(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
|
||||
$(RM) -r doc/doxy/html
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
* 0.10 "Freedom" January, 2012
|
||||
* 1.1 "Fire Flower" January, 2013
|
||||
|
||||
|
||||
General notes
|
||||
@@ -20,3 +20,6 @@ compiler. Since MSVC does not support C99 features used extensively by FFmpeg,
|
||||
this has been accomplished using a converter that turns C99 code to C89. See the
|
||||
platform-specific documentation for more detailed documentation on building
|
||||
FFmpeg with MSVC.
|
||||
|
||||
The used output sample format for several audio decoders has changed, make
|
||||
sure you always check/use AVCodecContext.sample_fmt or AVFrame.format.
|
||||
|
@@ -190,8 +190,8 @@ set shiftwidth=4
|
||||
set softtabstop=4
|
||||
set cindent
|
||||
set cinoptions=(0
|
||||
" allow tabs in Makefiles
|
||||
autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=8
|
||||
" Allow tabs in Makefiles.
|
||||
autocmd FileType make,automake set noexpandtab shiftwidth=8 softtabstop=8
|
||||
" Trailing whitespace and tabs are forbidden, so highlight them.
|
||||
highlight ForbiddenWhitespace ctermbg=red guibg=red
|
||||
match ForbiddenWhitespace /\s\+$\|\t/
|
||||
|
@@ -314,7 +314,7 @@ int main (int argc, char **argv)
|
||||
if (audio_stream) {
|
||||
const char *fmt;
|
||||
|
||||
if ((ret = get_format_from_sample_fmt(&fmt, audio_dec_ctx->sample_fmt) < 0))
|
||||
if ((ret = get_format_from_sample_fmt(&fmt, audio_dec_ctx->sample_fmt)) < 0)
|
||||
goto end;
|
||||
printf("Play the output audio file with the command:\n"
|
||||
"ffplay -f %s -ac %d -ar %d %s\n",
|
||||
|
@@ -200,7 +200,7 @@ int main(int argc, char **argv)
|
||||
fwrite(dst_data[0], 1, dst_bufsize, dst_file);
|
||||
} while (t < 10);
|
||||
|
||||
if ((ret = get_format_from_sample_fmt(&fmt, dst_sample_fmt) < 0))
|
||||
if ((ret = get_format_from_sample_fmt(&fmt, dst_sample_fmt)) < 0)
|
||||
goto end;
|
||||
fprintf(stderr, "Resampling succeeded. Play the output file with the command:\n"
|
||||
"ffplay -f %s -channel_layout %"PRId64" -channels %d -ar %d %s\n",
|
||||
|
@@ -978,7 +978,7 @@ ffmpeg -filter_complex 'color=red' -t 5 out.mkv
|
||||
|
||||
As a special exception, you can use a bitmap subtitle stream as input: it
|
||||
will be converted into a video with the same size as the largest video in
|
||||
the file, or 720×576 if no video is present. Note that this is an
|
||||
the file, or 720x576 if no video is present. Note that this is an
|
||||
experimental and temporary solution. It will be removed once libavfilter has
|
||||
proper support for subtitles.
|
||||
|
||||
|
@@ -179,7 +179,7 @@ Follows a BNF description for the filtergraph syntax:
|
||||
@var{LINKLABEL} ::= "[" @var{NAME} "]"
|
||||
@var{LINKLABELS} ::= @var{LINKLABEL} [@var{LINKLABELS}]
|
||||
@var{FILTER_ARGUMENTS} ::= sequence of chars (eventually quoted)
|
||||
@var{FILTER} ::= [@var{LINKNAMES}] @var{NAME} ["=" @var{ARGUMENTS}] [@var{LINKNAMES}]
|
||||
@var{FILTER} ::= [@var{LINKLABELS}] @var{NAME} ["=" @var{FILTER_ARGUMENTS}] [@var{LINKLABELS}]
|
||||
@var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}]
|
||||
@var{FILTERGRAPH} ::= [sws_flags=@var{flags};] @var{FILTERCHAIN} [;@var{FILTERGRAPH}]
|
||||
@end example
|
||||
@@ -4149,7 +4149,7 @@ Alternatively, the options can be specified as a flat string:
|
||||
|
||||
@var{layout}[:@var{nb_frames}[:@var{margin}[:@var{padding}]]]
|
||||
|
||||
For example, produce 8×8 PNG tiles of all keyframes (@option{-skip_frame
|
||||
For example, produce 8x8 PNG tiles of all keyframes (@option{-skip_frame
|
||||
nokey}) in a movie:
|
||||
@example
|
||||
ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
|
||||
@@ -5543,7 +5543,7 @@ Activate unsafe mode: do not fail if segments have a different format.
|
||||
The filter has @var{v}+@var{a} outputs: first @var{v} video outputs, then
|
||||
@var{a} audio outputs.
|
||||
|
||||
There are @var{n}×(@var{v}+@var{a}) inputs: first the inputs for the first
|
||||
There are @var{n}x(@var{v}+@var{a}) inputs: first the inputs for the first
|
||||
segment, in the same order as the outputs, then the inputs for the second
|
||||
segment, etc.
|
||||
|
||||
|
@@ -711,10 +711,11 @@ Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
|
||||
ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
|
||||
@end example
|
||||
|
||||
Attach a picture to an mp3:
|
||||
To attach a picture to an mp3 file select both the audio and the picture stream
|
||||
with @code{map}:
|
||||
@example
|
||||
ffmpeg -i input.mp3 -i cover.png -c copy -metadata:s:v title="Album cover"
|
||||
-metadata:s:v comment="Cover (Front)" out.mp3
|
||||
ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
|
||||
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
|
||||
@end example
|
||||
|
||||
@c man end MUXERS
|
||||
|
@@ -114,7 +114,7 @@ wrapper.
|
||||
You will need the following prerequisites:
|
||||
|
||||
@itemize
|
||||
@item @uref{https://github.com/libav/c99-to-c89/, C99-to-C89 Converter & Wrapper}
|
||||
@item @uref{http://download.videolan.org/pub/contrib/c99-to-c89/, C99-to-C89 Converter & Wrapper}
|
||||
@item @uref{http://code.google.com/p/msinttypes/, msinttypes}
|
||||
@item @uref{http://www.mingw.org/, MSYS}
|
||||
@item @uref{http://yasm.tortall.net/, YASM}
|
||||
|
9
ffmpeg.c
9
ffmpeg.c
@@ -471,7 +471,6 @@ static void exit_program(void)
|
||||
if (received_sigterm) {
|
||||
av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
|
||||
(int) received_sigterm);
|
||||
exit (255);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2100,6 +2099,12 @@ static int transcode_init(void)
|
||||
codec->time_base.num *= icodec->ticks_per_frame;
|
||||
}
|
||||
}
|
||||
if ( codec->codec_tag == AV_RL32("tmcd")
|
||||
&& icodec->time_base.num < icodec->time_base.den
|
||||
&& icodec->time_base.num > 0
|
||||
&& 121LL*icodec->time_base.num > icodec->time_base.den) {
|
||||
codec->time_base = icodec->time_base;
|
||||
}
|
||||
|
||||
if(ost->frame_rate.num)
|
||||
codec->time_base = av_inv_q(ost->frame_rate);
|
||||
@@ -3214,6 +3219,6 @@ int main(int argc, char **argv)
|
||||
printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
exit(received_nb_signals ? 255 : 0);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1143,8 +1143,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
if (p) p++;
|
||||
}
|
||||
video_enc->rc_override_count = i;
|
||||
if (!video_enc->rc_initial_buffer_occupancy)
|
||||
video_enc->rc_initial_buffer_occupancy = video_enc->rc_buffer_size * 3 / 4;
|
||||
video_enc->intra_dc_precision = intra_dc_precision - 8;
|
||||
|
||||
if (do_psnr)
|
||||
@@ -1155,9 +1153,11 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
||||
if (do_pass) {
|
||||
if (do_pass & 1) {
|
||||
video_enc->flags |= CODEC_FLAG_PASS1;
|
||||
av_dict_set(&ost->opts, "flags", "+pass1", AV_DICT_APPEND);
|
||||
}
|
||||
if (do_pass & 2) {
|
||||
video_enc->flags |= CODEC_FLAG_PASS2;
|
||||
av_dict_set(&ost->opts, "flags", "+pass2", AV_DICT_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2150,7 +2150,7 @@ static int opt_channel_layout(void *optctx, const char *opt, const char *arg)
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
snprintf(layout_str, sizeof(layout_str), "%"PRIu64, layout);
|
||||
ret = opt_default(NULL, opt, layout_str);
|
||||
ret = opt_default_new(o, opt, layout_str);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@@ -44,7 +44,7 @@ static av_cold int zero12v_decode_init(AVCodecContext *avctx)
|
||||
static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame, AVPacket *avpkt)
|
||||
{
|
||||
int line = 0;
|
||||
int line = 0, ret;
|
||||
const int width = avctx->width;
|
||||
AVFrame *pic = avctx->coded_frame;
|
||||
uint16_t *y, *u, *v;
|
||||
@@ -65,8 +65,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
pic->reference = 0;
|
||||
if (ff_get_buffer(avctx, pic) < 0)
|
||||
return AVERROR_INVALIDDATA;;
|
||||
if ((ret = ff_get_buffer(avctx, pic)) < 0)
|
||||
return ret;
|
||||
|
||||
y = (uint16_t *)pic->data[0];
|
||||
u = (uint16_t *)pic->data[1];
|
||||
|
@@ -749,8 +749,10 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
|
||||
}
|
||||
|
||||
prestream = read_huffman_tables(f, prestream, buf + length - prestream);
|
||||
if (!prestream)
|
||||
return -1;
|
||||
if (!prestream) {
|
||||
av_log(f->avctx, AV_LOG_ERROR, "Error reading Huffman tables.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
init_get_bits(&f->gb, buf + 4, 8 * bitstream_size);
|
||||
|
||||
|
@@ -25,7 +25,6 @@ OBJS = allcodecs.o \
|
||||
fmtconvert.o \
|
||||
imgconvert.o \
|
||||
jrevdct.o \
|
||||
log2_tab.o \
|
||||
mathtables.o \
|
||||
options.o \
|
||||
parser.o \
|
||||
@@ -39,6 +38,7 @@ OBJS = allcodecs.o \
|
||||
# parts needed for many different codecs
|
||||
OBJS-$(CONFIG_AANDCTTABLES) += aandcttab.o
|
||||
OBJS-$(CONFIG_AC3DSP) += ac3dsp.o
|
||||
OBJS-$(CONFIG_AUDIO_FRAME_QUEUE) += audio_frame_queue.o
|
||||
OBJS-$(CONFIG_CRYSTALHD) += crystalhd.o
|
||||
OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
|
||||
OBJS-$(CONFIG_DWT) += dwt.o snow.o
|
||||
@@ -68,6 +68,7 @@ OBJS-$(CONFIG_MPEGVIDEOENC) += mpegvideo_enc.o mpeg12data.o \
|
||||
OBJS-$(CONFIG_RANGECODER) += rangecoder.o
|
||||
RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o
|
||||
OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
|
||||
OBJS-$(CONFIG_SHARED) += log2_tab.o
|
||||
OBJS-$(CONFIG_SINEWIN) += sinewin.o
|
||||
OBJS-$(CONFIG_VAAPI) += vaapi.o
|
||||
OBJS-$(CONFIG_VDPAU) += vdpau.o
|
||||
@@ -84,8 +85,7 @@ OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps.o \
|
||||
OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
|
||||
aacpsy.o aactab.o \
|
||||
psymodel.o iirfilter.o \
|
||||
mpeg4audio.o kbdwin.o \
|
||||
audio_frame_queue.o
|
||||
mpeg4audio.o kbdwin.o
|
||||
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
|
||||
OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3dec_data.o ac3.o kbdwin.o
|
||||
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3enc.o ac3tab.o \
|
||||
@@ -317,8 +317,7 @@ OBJS-$(CONFIG_MVC1_DECODER) += mvcdec.o
|
||||
OBJS-$(CONFIG_MVC2_DECODER) += mvcdec.o
|
||||
OBJS-$(CONFIG_MXPEG_DECODER) += mxpegdec.o mjpegdec.o mjpeg.o
|
||||
OBJS-$(CONFIG_NELLYMOSER_DECODER) += nellymoserdec.o nellymoser.o
|
||||
OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o \
|
||||
audio_frame_queue.o
|
||||
OBJS-$(CONFIG_NELLYMOSER_ENCODER) += nellymoserenc.o nellymoser.o
|
||||
OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o
|
||||
OBJS-$(CONFIG_PAF_VIDEO_DECODER) += paf.o
|
||||
OBJS-$(CONFIG_PAF_AUDIO_DECODER) += paf.o
|
||||
@@ -358,8 +357,7 @@ OBJS-$(CONFIG_R10K_ENCODER) += r210enc.o
|
||||
OBJS-$(CONFIG_R210_DECODER) += r210dec.o
|
||||
OBJS-$(CONFIG_R210_ENCODER) += r210enc.o
|
||||
OBJS-$(CONFIG_RA_144_DECODER) += ra144dec.o ra144.o celp_filters.o
|
||||
OBJS-$(CONFIG_RA_144_ENCODER) += ra144enc.o ra144.o celp_filters.o \
|
||||
audio_frame_queue.o
|
||||
OBJS-$(CONFIG_RA_144_ENCODER) += ra144enc.o ra144.o celp_filters.o
|
||||
OBJS-$(CONFIG_RA_288_DECODER) += ra288.o celp_filters.o
|
||||
OBJS-$(CONFIG_RALF_DECODER) += ralf.o
|
||||
OBJS-$(CONFIG_RAWVIDEO_DECODER) += rawdec.o
|
||||
@@ -660,43 +658,39 @@ OBJS-$(CONFIG_WTV_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
||||
# external codec libraries
|
||||
OBJS-$(CONFIG_LIBAACPLUS_ENCODER) += libaacplus.o
|
||||
OBJS-$(CONFIG_LIBCELT_DECODER) += libcelt_dec.o
|
||||
OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o audio_frame_queue.o
|
||||
OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o audio_frame_queue.o
|
||||
OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o
|
||||
OBJS-$(CONFIG_LIBFDK_AAC_ENCODER) += libfdk-aacenc.o
|
||||
OBJS-$(CONFIG_LIBGSM_DECODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBGSM_ENCODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBGSM_MS_DECODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBGSM_MS_ENCODER) += libgsm.o
|
||||
OBJS-$(CONFIG_LIBILBC_DECODER) += libilbc.o
|
||||
OBJS-$(CONFIG_LIBILBC_ENCODER) += libilbc.o
|
||||
OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o mpegaudiodecheader.o \
|
||||
audio_frame_queue.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o \
|
||||
audio_frame_queue.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o \
|
||||
audio_frame_queue.o
|
||||
OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o mpegaudiodecheader.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o
|
||||
OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER) += libopencore-amr.o
|
||||
OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpegdec.o
|
||||
OBJS-$(CONFIG_LIBOPENJPEG_ENCODER) += libopenjpegenc.o
|
||||
OBJS-$(CONFIG_LIBOPUS_DECODER) += libopusdec.o libopus.o \
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_LIBOPUS_ENCODER) += libopusenc.o libopus.o \
|
||||
vorbis_data.o audio_frame_queue.o
|
||||
vorbis_data.o
|
||||
OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o \
|
||||
libschroedinger.o
|
||||
OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o \
|
||||
libschroedinger.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o audio_frame_queue.o
|
||||
OBJS-$(CONFIG_LIBSPEEX_ENCODER) += libspeexenc.o
|
||||
OBJS-$(CONFIG_LIBSTAGEFRIGHT_H264_DECODER)+= libstagefright.o
|
||||
OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o
|
||||
OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
|
||||
OBJS-$(CONFIG_LIBUTVIDEO_DECODER) += libutvideodec.o
|
||||
OBJS-$(CONFIG_LIBUTVIDEO_ENCODER) += libutvideoenc.o
|
||||
OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o \
|
||||
audio_frame_queue.o
|
||||
OBJS-$(CONFIG_LIBVO_AACENC_ENCODER) += libvo-aacenc.o mpeg4audio.o
|
||||
OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_DECODER) += libvorbisdec.o
|
||||
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o audio_frame_queue.o \
|
||||
OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbisenc.o \
|
||||
vorbis_data.o vorbis_parser.o xiph.o
|
||||
OBJS-$(CONFIG_LIBVPX_DECODER) += libvpxdec.o
|
||||
OBJS-$(CONFIG_LIBVPX_ENCODER) += libvpxenc.o
|
||||
|
@@ -113,6 +113,10 @@
|
||||
static VLC vlc_scalefactors;
|
||||
static VLC vlc_spectral[11];
|
||||
|
||||
static int output_configure(AACContext *ac,
|
||||
uint8_t layout_map[MAX_ELEM_ID*4][3], int tags,
|
||||
enum OCStatus oc_type, int get_new_frame);
|
||||
|
||||
#define overread_err "Input buffer exhausted before END element found\n"
|
||||
|
||||
static int count_channels(uint8_t (*layout)[3], int tags)
|
||||
@@ -143,6 +147,8 @@ static av_cold int che_configure(AACContext *ac,
|
||||
enum ChannelPosition che_pos,
|
||||
int type, int id, int *channels)
|
||||
{
|
||||
if (*channels >= MAX_CHANNELS)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (che_pos) {
|
||||
if (!ac->che[type][id]) {
|
||||
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
|
||||
@@ -406,6 +412,8 @@ static void pop_output_configuration(AACContext *ac) {
|
||||
ac->oc[1] = ac->oc[0];
|
||||
ac->avctx->channels = ac->oc[1].channels;
|
||||
ac->avctx->channel_layout = ac->oc[1].channel_layout;
|
||||
output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
|
||||
ac->oc[1].status, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -914,6 +922,11 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
|
||||
}
|
||||
}
|
||||
|
||||
if (avctx->channels > MAX_CHANNELS) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
AAC_INIT_VLC_STATIC( 0, 304);
|
||||
AAC_INIT_VLC_STATIC( 1, 270);
|
||||
AAC_INIT_VLC_STATIC( 2, 550);
|
||||
|
@@ -517,7 +517,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
|
||||
/* add current frame to queue */
|
||||
if (frame) {
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -1121,7 +1121,12 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
||||
for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) {
|
||||
float temp1 = exp2f(sbr->data[0].env_facs[e][k] * alpha + 7.0f);
|
||||
float temp2 = exp2f((pan_offset - sbr->data[1].env_facs[e][k]) * alpha);
|
||||
float fac = temp1 / (1.0f + temp2);
|
||||
float fac;
|
||||
if (temp1 > 1E20) {
|
||||
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||
temp1 = 1;
|
||||
}
|
||||
fac = temp1 / (1.0f + temp2);
|
||||
sbr->data[0].env_facs[e][k] = fac;
|
||||
sbr->data[1].env_facs[e][k] = fac * temp2;
|
||||
}
|
||||
@@ -1130,7 +1135,12 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
||||
for (k = 0; k < sbr->n_q; k++) {
|
||||
float temp1 = exp2f(NOISE_FLOOR_OFFSET - sbr->data[0].noise_facs[e][k] + 1);
|
||||
float temp2 = exp2f(12 - sbr->data[1].noise_facs[e][k]);
|
||||
float fac = temp1 / (1.0f + temp2);
|
||||
float fac;
|
||||
if (temp1 > 1E20) {
|
||||
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||
temp1 = 1;
|
||||
}
|
||||
fac = temp1 / (1.0f + temp2);
|
||||
sbr->data[0].noise_facs[e][k] = fac;
|
||||
sbr->data[1].noise_facs[e][k] = fac * temp2;
|
||||
}
|
||||
@@ -1139,9 +1149,15 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
||||
for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) {
|
||||
float alpha = sbr->data[ch].bs_amp_res ? 1.0f : 0.5f;
|
||||
for (e = 1; e <= sbr->data[ch].bs_num_env; e++)
|
||||
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++)
|
||||
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++){
|
||||
sbr->data[ch].env_facs[e][k] =
|
||||
exp2f(alpha * sbr->data[ch].env_facs[e][k] + 6.0f);
|
||||
if (sbr->data[ch].env_facs[e][k] > 1E20) {
|
||||
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||
sbr->data[ch].env_facs[e][k] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
|
||||
for (k = 0; k < sbr->n_q; k++)
|
||||
sbr->data[ch].noise_facs[e][k] =
|
||||
|
@@ -60,7 +60,7 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx)
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
avctx->pix_fmt = AV_PIX_FMT_RGB555;
|
||||
avctx->pix_fmt = AV_PIX_FMT_RGB555LE;
|
||||
break;
|
||||
case 24:
|
||||
avctx->pix_fmt = AV_PIX_FMT_BGR24;
|
||||
|
@@ -1336,8 +1336,10 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
||||
if (!err) {
|
||||
avctx->sample_rate = s->sample_rate;
|
||||
avctx->bit_rate = s->bit_rate;
|
||||
}
|
||||
|
||||
/* channel config */
|
||||
/* channel config */
|
||||
if (!err || (s->channels && s->out_channels != s->channels)) {
|
||||
s->out_channels = s->channels;
|
||||
s->output_mode = s->channel_mode;
|
||||
if (s->lfe_on)
|
||||
@@ -1360,22 +1362,18 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
|
||||
s->fbw_channels == s->out_channels)) {
|
||||
set_downmix_coeffs(s);
|
||||
}
|
||||
} else if (!s->out_channels) {
|
||||
s->out_channels = avctx->channels;
|
||||
if (s->out_channels < s->channels)
|
||||
s->output_mode = s->out_channels == 1 ? AC3_CHMODE_MONO : AC3_CHMODE_STEREO;
|
||||
}
|
||||
if (avctx->channels != s->out_channels) {
|
||||
av_log(avctx, AV_LOG_ERROR, "channel number mismatching on damaged frame\n");
|
||||
} else if (!s->channels) {
|
||||
av_log(avctx, AV_LOG_ERROR, "unable to determine channel mode\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
avctx->channels = s->out_channels;
|
||||
|
||||
/* set audio service type based on bitstream mode for AC-3 */
|
||||
avctx->audio_service_type = s->bitstream_mode;
|
||||
if (s->bitstream_mode == 0x7 && s->channels > 1)
|
||||
avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
|
||||
|
||||
/* get output buffer */
|
||||
avctx->channels = s->out_channels;
|
||||
s->frame.nb_samples = s->num_blocks * 256;
|
||||
if ((ret = ff_get_buffer(avctx, &s->frame)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include "config.h"
|
||||
#include "libavutil/arm/asm.S"
|
||||
|
||||
#if HAVE_ARMV5TE_EXTERNAL
|
||||
function ff_prefetch_arm, export=1
|
||||
subs r2, r2, #1
|
||||
pld [r0]
|
||||
@@ -30,4 +29,3 @@ function ff_prefetch_arm, export=1
|
||||
bne ff_prefetch_arm
|
||||
bx lr
|
||||
endfunc
|
||||
#endif
|
||||
|
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include <libavcodec/videodsp.h>
|
||||
#include "libavcodec/videodsp.h"
|
||||
#include "videodsp_arm.h"
|
||||
|
||||
void ff_prefetch_arm(uint8_t *mem, ptrdiff_t stride, int h);
|
||||
|
@@ -124,14 +124,14 @@ function ff_vp8_luma_dc_wht_armv6, export=1
|
||||
sbfx r1, r9, #3, #13
|
||||
sbfx r10, r4, #3, #13
|
||||
#else
|
||||
sxth r8, r8
|
||||
sxth r7, r7
|
||||
sxth r9, r9
|
||||
sxth r4, r4
|
||||
asr r8, #3 @ block[0][0]
|
||||
asr r7, #3 @ block[0][1]
|
||||
asr r9, #3 @ block[0][2]
|
||||
asr r4, #3 @ block[0][3]
|
||||
sxth r6, r8
|
||||
sxth r12, r7
|
||||
sxth r1, r9
|
||||
sxth r10, r4
|
||||
asr r6, #3 @ block[0][0]
|
||||
asr r12, #3 @ block[0][1]
|
||||
asr r1, #3 @ block[0][2]
|
||||
asr r10, #3 @ block[0][3]
|
||||
#endif
|
||||
|
||||
strh r6, [r0], #32
|
||||
|
@@ -165,7 +165,10 @@ static int decode_bytes(const uint8_t *input, uint8_t *out, int bytes)
|
||||
|
||||
off = (intptr_t)input & 3;
|
||||
buf = (const uint32_t *)(input - off);
|
||||
c = av_be2ne32((0x537F6103 >> (off * 8)) | (0x537F6103 << (32 - (off * 8))));
|
||||
if (off)
|
||||
c = av_be2ne32((0x537F6103U >> (off * 8)) | (0x537F6103U << (32 - (off * 8))));
|
||||
else
|
||||
c = av_be2ne32(0x537F6103U);
|
||||
bytes += 3 + off;
|
||||
for (i = 0; i < bytes / 4; i++)
|
||||
output[i] = c ^ buf[i];
|
||||
@@ -518,7 +521,7 @@ static int add_tonal_components(float *spectrum, int num_components,
|
||||
output = &spectrum[components[i].pos];
|
||||
|
||||
for (j = 0; j < components[i].num_coefs; j++)
|
||||
output[i] += input[i];
|
||||
output[j] += input[j];
|
||||
}
|
||||
|
||||
return last_pos;
|
||||
|
@@ -170,7 +170,7 @@ static void init_lengths(BinkContext *c, int width, int bw)
|
||||
*
|
||||
* @param c decoder context
|
||||
*/
|
||||
static av_cold void init_bundles(BinkContext *c)
|
||||
static av_cold int init_bundles(BinkContext *c)
|
||||
{
|
||||
int bw, bh, blocks;
|
||||
int i;
|
||||
@@ -181,8 +181,12 @@ static av_cold void init_bundles(BinkContext *c)
|
||||
|
||||
for (i = 0; i < BINKB_NB_SRC; i++) {
|
||||
c->bundle[i].data = av_malloc(blocks * 64);
|
||||
if (!c->bundle[i].data)
|
||||
return AVERROR(ENOMEM);
|
||||
c->bundle[i].data_end = c->bundle[i].data + blocks * 64;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1264,7 +1268,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
BinkContext * const c = avctx->priv_data;
|
||||
static VLC_TYPE table[16 * 128][2];
|
||||
static int binkb_initialised = 0;
|
||||
int i;
|
||||
int i, ret;
|
||||
int flags;
|
||||
|
||||
c->version = avctx->codec_tag >> 24;
|
||||
@@ -1299,7 +1303,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
ff_dsputil_init(&c->dsp, avctx);
|
||||
ff_binkdsp_init(&c->bdsp);
|
||||
|
||||
init_bundles(c);
|
||||
if ((ret = init_bundles(c)) < 0) {
|
||||
free_bundles(c);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (c->version == 'b') {
|
||||
if (!binkb_initialised) {
|
||||
|
@@ -140,7 +140,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
|
||||
mode += 1 + advance_mode;
|
||||
if (mode >= 4)
|
||||
mode -= 3;
|
||||
if (FFABS(dst_end - dst) < len)
|
||||
if (len <= 0 || FFABS(dst_end - dst) < len)
|
||||
return -1;
|
||||
switch (mode) {
|
||||
case 1:
|
||||
|
@@ -296,7 +296,9 @@ static int cdg_decode_frame(AVCodecContext *avctx,
|
||||
inst = bytestream_get_byte(&buf);
|
||||
inst &= CDG_MASK;
|
||||
buf += 2; /// skipping 2 unneeded bytes
|
||||
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
|
||||
|
||||
if (buf_size > CDG_HEADER_SIZE)
|
||||
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
|
||||
|
||||
if ((command & CDG_MASK) == CDG_COMMAND) {
|
||||
switch (inst) {
|
||||
|
@@ -263,6 +263,8 @@ static int decode_wdlt(GetByteContext *gb, uint8_t *frame, int width, int height
|
||||
segments = bytestream2_get_le16(gb);
|
||||
}
|
||||
line_ptr = frame;
|
||||
if (frame_end - frame < width)
|
||||
return AVERROR_INVALIDDATA;
|
||||
frame += width;
|
||||
y++;
|
||||
while (segments--) {
|
||||
|
@@ -237,7 +237,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb,
|
||||
|
||||
avctx->pix_fmt = dirac_pix_fmt[!luma_offset][source->chroma_format];
|
||||
avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_x_shift, &chroma_y_shift);
|
||||
if (!(source->width % (1<<chroma_x_shift)) || !(source->height % (1<<chroma_y_shift))) {
|
||||
if ((source->width % (1<<chroma_x_shift)) || (source->height % (1<<chroma_y_shift))) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Dimensions must be a integer multiply of the chroma subsampling\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
@@ -406,7 +406,7 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
|
||||
*picture = ctx->picture;
|
||||
*got_frame = 1;
|
||||
return buf_size;
|
||||
return avpkt->size;
|
||||
}
|
||||
|
||||
static av_cold int dnxhd_decode_close(AVCodecContext *avctx)
|
||||
|
@@ -629,14 +629,35 @@ static void dnxhd_setup_threads_slices(DNXHDEncContext *ctx)
|
||||
static int dnxhd_mb_var_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
|
||||
{
|
||||
DNXHDEncContext *ctx = avctx->priv_data;
|
||||
int mb_y = jobnr, mb_x;
|
||||
int mb_y = jobnr, mb_x, x, y;
|
||||
int partial_last_row = (mb_y == ctx->m.mb_height - 1) &&
|
||||
((avctx->height >> ctx->interlaced) & 0xF);
|
||||
|
||||
ctx = ctx->thread[threadnr];
|
||||
if (ctx->cid_table->bit_depth == 8) {
|
||||
uint8_t *pix = ctx->thread[0]->src[0] + ((mb_y<<4) * ctx->m.linesize);
|
||||
for (mb_x = 0; mb_x < ctx->m.mb_width; ++mb_x, pix += 16) {
|
||||
unsigned mb = mb_y * ctx->m.mb_width + mb_x;
|
||||
int sum = ctx->m.dsp.pix_sum(pix, ctx->m.linesize);
|
||||
int varc = (ctx->m.dsp.pix_norm1(pix, ctx->m.linesize) - (((unsigned)sum*sum)>>8)+128)>>8;
|
||||
int sum;
|
||||
int varc;
|
||||
|
||||
if (!partial_last_row && mb_x * 16 <= avctx->width - 16) {
|
||||
sum = ctx->m.dsp.pix_sum(pix, ctx->m.linesize);
|
||||
varc = ctx->m.dsp.pix_norm1(pix, ctx->m.linesize);
|
||||
} else {
|
||||
int bw = FFMIN(avctx->width - 16 * mb_x, 16);
|
||||
int bh = FFMIN((avctx->height >> ctx->interlaced) - 16 * mb_y, 16);
|
||||
sum = varc = 0;
|
||||
for (y = 0; y < bh; y++) {
|
||||
for (x = 0; x < bw; x++) {
|
||||
uint8_t val = pix[x + y * ctx->m.linesize];
|
||||
sum += val;
|
||||
varc += val * val;
|
||||
}
|
||||
}
|
||||
}
|
||||
varc = (varc - (((unsigned)sum * sum) >> 8) + 128) >> 8;
|
||||
|
||||
ctx->mb_cmp[mb].value = varc;
|
||||
ctx->mb_cmp[mb].mb = mb;
|
||||
}
|
||||
|
@@ -212,6 +212,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
buf[803] = s->bits_per_component;
|
||||
write16(buf + 804, (s->bits_per_component == 10 || s->bits_per_component == 12) ?
|
||||
1 : 0); /* packing method */
|
||||
write32(buf + 808, HEADER_SIZE); /* data offset */
|
||||
|
||||
/* Image source information header */
|
||||
write32(buf + 1628, avctx->sample_aspect_ratio.num);
|
||||
|
@@ -276,6 +276,21 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
}
|
||||
}
|
||||
|
||||
if (inter && !s->last_frame.data[0]) {
|
||||
int ret;
|
||||
av_log(avctx, AV_LOG_WARNING, "Missing reference frame.\n");
|
||||
s->last_frame.reference = 1;
|
||||
ret = ff_get_buffer(avctx, &s->last_frame);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
memset(s->last_frame.data[0], 0, s->last_frame.height *
|
||||
s->last_frame.linesize[0]);
|
||||
memset(s->last_frame.data[1], 0x80, s->last_frame.height / 2 *
|
||||
s->last_frame.linesize[1]);
|
||||
memset(s->last_frame.data[2], 0x80, s->last_frame.height / 2 *
|
||||
s->last_frame.linesize[2]);
|
||||
}
|
||||
|
||||
av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size,
|
||||
buf_end - buf);
|
||||
if (!s->bitstream_buf)
|
||||
|
@@ -924,6 +924,12 @@ void ff_er_frame_end(MpegEncContext *s)
|
||||
return;
|
||||
};
|
||||
|
||||
if ( s->picture_structure == PICT_FRAME
|
||||
&& s->current_picture.f.linesize[0] != s->current_picture_ptr->f.linesize[0]) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Error concealment not possible, frame not fully initialized\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (s->current_picture.f.motion_val[0] == NULL) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
|
||||
|
||||
|
@@ -27,7 +27,7 @@ const int ff_flac_sample_rate_table[16] =
|
||||
8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
|
||||
0, 0, 0, 0 };
|
||||
|
||||
const int16_t ff_flac_blocksize_table[16] = {
|
||||
const int32_t ff_flac_blocksize_table[16] = {
|
||||
0, 192, 576<<0, 576<<1, 576<<2, 576<<3, 0, 0,
|
||||
256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7
|
||||
};
|
||||
|
@@ -26,6 +26,6 @@
|
||||
|
||||
extern const int ff_flac_sample_rate_table[16];
|
||||
|
||||
extern const int16_t ff_flac_blocksize_table[16];
|
||||
extern const int32_t ff_flac_blocksize_table[16];
|
||||
|
||||
#endif /* AVCODEC_FLACDATA_H */
|
||||
|
@@ -387,6 +387,11 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx,
|
||||
if (bytestream2_tell(&g2) + 1 > stream_ptr_after_chunk)
|
||||
break;
|
||||
byte_run = sign_extend(bytestream2_get_byte(&g2), 8);
|
||||
if (!byte_run) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid byte run value.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (byte_run > 0) {
|
||||
palette_idx1 = bytestream2_get_byte(&g2);
|
||||
CHECK_PIXEL_PTR(byte_run);
|
||||
|
@@ -245,10 +245,10 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
|
||||
case 1:
|
||||
/* Fraps v1 is an upside-down BGR24 */
|
||||
for(y=0; y<avctx->height; y++)
|
||||
memcpy(&f->data[0][ (avctx->height-y)*f->linesize[0] ],
|
||||
&buf[y*avctx->width*3],
|
||||
3*avctx->width);
|
||||
for(y=0; y<avctx->height; y++)
|
||||
memcpy(&f->data[0][ (avctx->height - y -1) * f->linesize[0]],
|
||||
&buf[y*avctx->width*3],
|
||||
3*avctx->width);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
@@ -366,25 +366,49 @@ static inline int check_marker(GetBitContext *s, const char *msg)
|
||||
}
|
||||
|
||||
/**
|
||||
* Inititalize GetBitContext.
|
||||
* @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes larger than the actual read bits
|
||||
* because some optimized bitstream readers read 32 or 64 bit at once and could read over the end
|
||||
* Initialize GetBitContext.
|
||||
* @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
|
||||
* larger than the actual read bits because some optimized bitstream
|
||||
* readers read 32 or 64 bit at once and could read over the end
|
||||
* @param bit_size the size of the buffer in bits
|
||||
* @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
|
||||
*/
|
||||
static inline void init_get_bits(GetBitContext *s, const uint8_t *buffer,
|
||||
int bit_size)
|
||||
static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer,
|
||||
int bit_size)
|
||||
{
|
||||
int buffer_size = (bit_size+7)>>3;
|
||||
if (buffer_size < 0 || bit_size < 0) {
|
||||
int buffer_size;
|
||||
int ret = 0;
|
||||
|
||||
if (bit_size >= INT_MAX - 7 || bit_size < 0 || !buffer) {
|
||||
buffer_size = bit_size = 0;
|
||||
buffer = NULL;
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
buffer_size = (bit_size + 7) >> 3;
|
||||
|
||||
s->buffer = buffer;
|
||||
s->size_in_bits = bit_size;
|
||||
s->size_in_bits_plus8 = bit_size + 8;
|
||||
s->buffer_end = buffer + buffer_size;
|
||||
s->index = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize GetBitContext.
|
||||
* @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes
|
||||
* larger than the actual read bits because some optimized bitstream
|
||||
* readers read 32 or 64 bit at once and could read over the end
|
||||
* @param byte_size the size of the buffer in bytes
|
||||
* @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow.
|
||||
*/
|
||||
static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
|
||||
int byte_size)
|
||||
{
|
||||
if (byte_size > INT_MAX / 8 || byte_size < 0)
|
||||
byte_size = -1;
|
||||
return init_get_bits(s, buffer, byte_size * 8);
|
||||
}
|
||||
|
||||
static inline void align_get_bits(GetBitContext *s)
|
||||
|
@@ -75,6 +75,7 @@ typedef struct GifState {
|
||||
|
||||
AVCodecContext *avctx;
|
||||
int keyframe;
|
||||
int keyframe_ok;
|
||||
int trans_color; /**< color value that is used instead of transparent color */
|
||||
} GifState;
|
||||
|
||||
@@ -118,7 +119,7 @@ static void gif_copy_img_rect(const uint32_t *src, uint32_t *dst,
|
||||
const uint32_t *src_px, *src_pr,
|
||||
*src_py = src + y_start,
|
||||
*dst_py = dst + y_start;
|
||||
const uint32_t *src_pb = src_py + t * linesize;
|
||||
const uint32_t *src_pb = src_py + h * linesize;
|
||||
uint32_t *dst_px;
|
||||
|
||||
for (; src_py < src_pb; src_py += linesize, dst_py += linesize) {
|
||||
@@ -471,6 +472,8 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
|
||||
}
|
||||
|
||||
if (s->keyframe) {
|
||||
s->keyframe_ok = 0;
|
||||
s->gce_prev_disposal = GCE_DISPOSAL_NONE;
|
||||
if ((ret = gif_read_header1(s)) < 0)
|
||||
return ret;
|
||||
|
||||
@@ -488,7 +491,13 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
|
||||
|
||||
s->picture.pict_type = AV_PICTURE_TYPE_I;
|
||||
s->picture.key_frame = 1;
|
||||
s->keyframe_ok = 1;
|
||||
} else {
|
||||
if (!s->keyframe_ok) {
|
||||
av_log(avctx, AV_LOG_ERROR, "cannot decode frame without keyframe\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = avctx->reget_buffer(avctx, &s->picture)) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
|
||||
return ret;
|
||||
|
@@ -309,10 +309,11 @@ static inline int get_lowest_part_list_y(H264Context *h, Picture *pic, int n,
|
||||
int height, int y_offset, int list)
|
||||
{
|
||||
int raw_my = h->mv_cache[list][scan8[n]][1];
|
||||
int filter_height = (raw_my & 3) ? 2 : 0;
|
||||
int filter_height_up = (raw_my & 3) ? 2 : 0;
|
||||
int filter_height_down = (raw_my & 3) ? 3 : 0;
|
||||
int full_my = (raw_my >> 2) + y_offset;
|
||||
int top = full_my - filter_height;
|
||||
int bottom = full_my + filter_height + height;
|
||||
int top = full_my - filter_height_up;
|
||||
int bottom = full_my + filter_height_down + height;
|
||||
|
||||
return FFMAX(abs(top), bottom);
|
||||
}
|
||||
@@ -2350,7 +2351,7 @@ static int field_end(H264Context *h, int in_setup)
|
||||
* past end by one (callers fault) and resync_mb_y != 0
|
||||
* causes problems for the first MB line, too.
|
||||
*/
|
||||
if (!FIELD_PICTURE)
|
||||
if (!FIELD_PICTURE && h->current_slice && !h->sps.new)
|
||||
ff_er_frame_end(s);
|
||||
|
||||
ff_MPV_frame_end(s);
|
||||
@@ -2442,6 +2443,12 @@ static int h264_set_parameter_from_sps(H264Context *h)
|
||||
if (s->avctx->has_b_frames < 2)
|
||||
s->avctx->has_b_frames = !s->low_delay;
|
||||
|
||||
if (h->sps.bit_depth_luma != h->sps.bit_depth_chroma) {
|
||||
av_log_missing_feature(s->avctx,
|
||||
"Different bit depth between chroma and luma", 1);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
if (s->avctx->bits_per_raw_sample != h->sps.bit_depth_luma ||
|
||||
h->cur_chroma_format_idc != h->sps.chroma_format_idc) {
|
||||
if (s->avctx->codec &&
|
||||
@@ -2474,7 +2481,7 @@ static int h264_set_parameter_from_sps(H264Context *h)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static enum PixelFormat get_pixel_format(H264Context *h)
|
||||
static enum PixelFormat get_pixel_format(H264Context *h, int force_callback)
|
||||
{
|
||||
MpegEncContext *const s = &h->s;
|
||||
switch (h->sps.bit_depth_luma) {
|
||||
@@ -2536,11 +2543,17 @@ static enum PixelFormat get_pixel_format(H264Context *h)
|
||||
return s->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P
|
||||
: AV_PIX_FMT_YUV422P;
|
||||
} else {
|
||||
return s->avctx->get_format(s->avctx, s->avctx->codec->pix_fmts ?
|
||||
int i;
|
||||
const enum AVPixelFormat * fmt = s->avctx->codec->pix_fmts ?
|
||||
s->avctx->codec->pix_fmts :
|
||||
s->avctx->color_range == AVCOL_RANGE_JPEG ?
|
||||
hwaccel_pixfmt_list_h264_jpeg_420 :
|
||||
ff_hwaccel_pixfmt_list_420);
|
||||
ff_hwaccel_pixfmt_list_420;
|
||||
|
||||
for (i=0; fmt[i] != AV_PIX_FMT_NONE; i++)
|
||||
if (fmt[i] == s->avctx->pix_fmt && !force_callback)
|
||||
return fmt[i];
|
||||
return s->avctx->get_format(s->avctx, fmt);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -2589,7 +2602,7 @@ static int h264_slice_header_init(H264Context *h, int reinit)
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
if ((ret = ff_MPV_common_init(s) < 0)) {
|
||||
if ((ret = ff_MPV_common_init(s)) < 0) {
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "ff_MPV_common_init() failed.\n");
|
||||
return ret;
|
||||
}
|
||||
@@ -2764,7 +2777,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
|| s->avctx->bits_per_raw_sample != h->sps.bit_depth_luma
|
||||
|| h->cur_chroma_format_idc != h->sps.chroma_format_idc
|
||||
|| av_cmp_q(h->sps.sar, s->avctx->sample_aspect_ratio)));
|
||||
|
||||
if (h0->s.avctx->pix_fmt != get_pixel_format(h0, 0))
|
||||
must_reinit = 1;
|
||||
|
||||
s->mb_width = h->sps.mb_width;
|
||||
s->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
|
||||
@@ -2801,7 +2815,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
|
||||
flush_change(h);
|
||||
|
||||
if ((ret = get_pixel_format(h)) < 0)
|
||||
if ((ret = get_pixel_format(h, 1)) < 0)
|
||||
return ret;
|
||||
s->avctx->pix_fmt = ret;
|
||||
|
||||
@@ -2822,7 +2836,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((ret = get_pixel_format(h)) < 0)
|
||||
if ((ret = get_pixel_format(h, 1)) < 0)
|
||||
return ret;
|
||||
s->avctx->pix_fmt = ret;
|
||||
|
||||
@@ -2966,6 +2980,9 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL;
|
||||
av_log(h->s.avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n",
|
||||
h->frame_num, h->prev_frame_num);
|
||||
if (!h->sps.gaps_in_frame_num_allowed_flag)
|
||||
for(i=0; i<FF_ARRAY_ELEMS(h->last_pocs); i++)
|
||||
h->last_pocs[i] = INT_MIN;
|
||||
if (ff_h264_frame_start(h) < 0)
|
||||
return -1;
|
||||
h->prev_frame_num++;
|
||||
@@ -2973,7 +2990,9 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
s->current_picture_ptr->frame_num = h->prev_frame_num;
|
||||
ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, 0);
|
||||
ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, 1);
|
||||
ff_generate_sliding_window_mmcos(h);
|
||||
if ((ret = ff_generate_sliding_window_mmcos(h, 1)) < 0 &&
|
||||
s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return ret;
|
||||
if (ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index) < 0 &&
|
||||
(s->avctx->err_recognition & AV_EF_EXPLODE))
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -3106,7 +3125,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
|
||||
if (h->ref_count[0]-1 > max[0] || h->ref_count[1]-1 > max[1]){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "reference overflow %u > %u or %u > %u\n", h->ref_count[0]-1, max[0], h->ref_count[1]-1, max[1]);
|
||||
h->ref_count[0] = h->ref_count[1] = 1;
|
||||
h->ref_count[0] = h->ref_count[1] = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -3114,8 +3133,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
h->list_count = 2;
|
||||
else
|
||||
h->list_count = 1;
|
||||
} else
|
||||
h->ref_count[1]= h->ref_count[0]= h->list_count= 0;
|
||||
} else {
|
||||
h->list_count = 0;
|
||||
h->ref_count[0] = h->ref_count[1] = 0;
|
||||
}
|
||||
|
||||
if (!default_ref_list_done)
|
||||
ff_h264_fill_default_ref_list(h);
|
||||
@@ -3152,7 +3173,15 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
||||
}
|
||||
}
|
||||
|
||||
if (h->nal_ref_idc && ff_h264_decode_ref_pic_marking(h0, &s->gb) < 0 &&
|
||||
// If frame-mt is enabled, only update mmco tables for the first slice
|
||||
// in a field. Subsequent slices can temporarily clobber h->mmco_index
|
||||
// or h->mmco, which will cause ref list mix-ups and decoding errors
|
||||
// further down the line. This may break decoding if the first slice is
|
||||
// corrupt, thus we only do this if frame-mt is enabled.
|
||||
if (h->nal_ref_idc &&
|
||||
ff_h264_decode_ref_pic_marking(h0, &s->gb,
|
||||
!(s->avctx->active_thread_type & FF_THREAD_FRAME) ||
|
||||
h0->current_slice == 0) < 0 &&
|
||||
(s->avctx->err_recognition & AV_EF_EXPLODE))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
|
@@ -669,9 +669,10 @@ void ff_h264_remove_all_refs(H264Context *h);
|
||||
*/
|
||||
int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count);
|
||||
|
||||
int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb);
|
||||
int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
|
||||
int first_slice);
|
||||
|
||||
void ff_generate_sliding_window_mmcos(H264Context *h);
|
||||
int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice);
|
||||
|
||||
/**
|
||||
* Check if the top & left blocks are available if needed & change the
|
||||
|
@@ -385,7 +385,7 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
|
||||
}
|
||||
sps->bit_depth_luma = get_ue_golomb(&s->gb) + 8;
|
||||
sps->bit_depth_chroma = get_ue_golomb(&s->gb) + 8;
|
||||
if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U) {
|
||||
if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U || sps->bit_depth_luma != sps->bit_depth_chroma) {
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
|
||||
sps->bit_depth_luma, sps->bit_depth_chroma);
|
||||
goto fail;
|
||||
|
@@ -287,7 +287,10 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h){
|
||||
for(list=0; list<h->list_count; list++){
|
||||
for(index= 0; index < h->ref_count[list]; index++){
|
||||
if (!h->ref_list[list][index].f.data[0]) {
|
||||
int i;
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "Missing reference picture, default is %d\n", h->default_ref_list[list][0].poc);
|
||||
for (i=0; i<FF_ARRAY_ELEMS(h->last_pocs); i++)
|
||||
h->last_pocs[i] = INT_MIN;
|
||||
if (h->default_ref_list[list][0].f.data[0])
|
||||
h->ref_list[list][index]= h->default_ref_list[list][0];
|
||||
else
|
||||
@@ -480,22 +483,50 @@ static void print_long_term(H264Context *h) {
|
||||
}
|
||||
}
|
||||
|
||||
void ff_generate_sliding_window_mmcos(H264Context *h) {
|
||||
MpegEncContext * const s = &h->s;
|
||||
static int check_opcodes(MMCO *mmco1, MMCO *mmco2, int n_mmcos)
|
||||
{
|
||||
int i;
|
||||
|
||||
h->mmco_index= 0;
|
||||
if(h->short_ref_count && h->long_ref_count + h->short_ref_count >= h->sps.ref_frame_count &&
|
||||
!(FIELD_PICTURE && !s->first_field && s->current_picture_ptr->f.reference)) {
|
||||
h->mmco[0].opcode= MMCO_SHORT2UNUSED;
|
||||
h->mmco[0].short_pic_num= h->short_ref[ h->short_ref_count - 1 ]->frame_num;
|
||||
h->mmco_index= 1;
|
||||
for (i = 0; i < n_mmcos; i++) {
|
||||
if (mmco1[i].opcode != mmco2[i].opcode)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice)
|
||||
{
|
||||
MpegEncContext * const s = &h->s;
|
||||
MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;
|
||||
int mmco_index = 0, i;
|
||||
|
||||
if (h->short_ref_count &&
|
||||
h->long_ref_count + h->short_ref_count >= h->sps.ref_frame_count &&
|
||||
!(FIELD_PICTURE && !s->first_field &&
|
||||
s->current_picture_ptr->f.reference)) {
|
||||
mmco[0].opcode = MMCO_SHORT2UNUSED;
|
||||
mmco[0].short_pic_num = h->short_ref[h->short_ref_count - 1]->frame_num;
|
||||
mmco_index = 1;
|
||||
if (FIELD_PICTURE) {
|
||||
h->mmco[0].short_pic_num *= 2;
|
||||
h->mmco[1].opcode= MMCO_SHORT2UNUSED;
|
||||
h->mmco[1].short_pic_num= h->mmco[0].short_pic_num + 1;
|
||||
h->mmco_index= 2;
|
||||
mmco[0].short_pic_num *= 2;
|
||||
mmco[1].opcode = MMCO_SHORT2UNUSED;
|
||||
mmco[1].short_pic_num = mmco[0].short_pic_num + 1;
|
||||
mmco_index = 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (first_slice) {
|
||||
h->mmco_index = mmco_index;
|
||||
} else if (!first_slice && mmco_index >= 0 &&
|
||||
(mmco_index != h->mmco_index ||
|
||||
(i = check_opcodes(h->mmco, mmco_temp, mmco_index)))) {
|
||||
av_log(h->s.avctx, AV_LOG_ERROR,
|
||||
"Inconsistent MMCO state between slices [%d, %d, %d]\n",
|
||||
mmco_index, h->mmco_index, i);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
|
||||
@@ -665,52 +696,86 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
|
||||
return (h->s.avctx->err_recognition & AV_EF_EXPLODE) ? err : 0;
|
||||
}
|
||||
|
||||
int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb){
|
||||
int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb,
|
||||
int first_slice)
|
||||
{
|
||||
MpegEncContext * const s = &h->s;
|
||||
int i;
|
||||
int i, ret;
|
||||
MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp;
|
||||
int mmco_index = 0;
|
||||
|
||||
h->mmco_index= 0;
|
||||
if(h->nal_unit_type == NAL_IDR_SLICE){ //FIXME fields
|
||||
s->broken_link= get_bits1(gb) -1;
|
||||
if(get_bits1(gb)){
|
||||
h->mmco[0].opcode= MMCO_LONG;
|
||||
h->mmco[0].long_arg= 0;
|
||||
h->mmco_index= 1;
|
||||
if (h->nal_unit_type == NAL_IDR_SLICE){ // FIXME fields
|
||||
s->broken_link = get_bits1(gb) - 1;
|
||||
if (get_bits1(gb)){
|
||||
mmco[0].opcode = MMCO_LONG;
|
||||
mmco[0].long_arg = 0;
|
||||
mmco_index = 1;
|
||||
}
|
||||
}else{
|
||||
if(get_bits1(gb)){ // adaptive_ref_pic_marking_mode_flag
|
||||
for(i= 0; i<MAX_MMCO_COUNT; i++) {
|
||||
MMCOOpcode opcode= get_ue_golomb_31(gb);
|
||||
} else {
|
||||
if (get_bits1(gb)) { // adaptive_ref_pic_marking_mode_flag
|
||||
for (i = 0; i < MAX_MMCO_COUNT; i++) {
|
||||
MMCOOpcode opcode = get_ue_golomb_31(gb);
|
||||
|
||||
h->mmco[i].opcode= opcode;
|
||||
if(opcode==MMCO_SHORT2UNUSED || opcode==MMCO_SHORT2LONG){
|
||||
h->mmco[i].short_pic_num= (h->curr_pic_num - get_ue_golomb(gb) - 1) & (h->max_pic_num - 1);
|
||||
/* if(h->mmco[i].short_pic_num >= h->short_ref_count || h->short_ref[ h->mmco[i].short_pic_num ] == NULL){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "illegal short ref in memory management control operation %d\n", mmco);
|
||||
return -1;
|
||||
}*/
|
||||
}
|
||||
if(opcode==MMCO_SHORT2LONG || opcode==MMCO_LONG2UNUSED || opcode==MMCO_LONG || opcode==MMCO_SET_MAX_LONG){
|
||||
unsigned int long_arg= get_ue_golomb_31(gb);
|
||||
if(long_arg >= 32 || (long_arg >= 16 && !(opcode == MMCO_SET_MAX_LONG && long_arg == 16) && !(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE))){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal long ref in memory management control operation %d\n", opcode);
|
||||
mmco[i].opcode = opcode;
|
||||
if (opcode == MMCO_SHORT2UNUSED || opcode == MMCO_SHORT2LONG){
|
||||
mmco[i].short_pic_num =
|
||||
(h->curr_pic_num - get_ue_golomb(gb) - 1) &
|
||||
(h->max_pic_num - 1);
|
||||
#if 0
|
||||
if (mmco[i].short_pic_num >= h->short_ref_count ||
|
||||
h->short_ref[ mmco[i].short_pic_num ] == NULL){
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"illegal short ref in memory management control "
|
||||
"operation %d\n", mmco);
|
||||
return -1;
|
||||
}
|
||||
h->mmco[i].long_arg= long_arg;
|
||||
#endif
|
||||
}
|
||||
if (opcode == MMCO_SHORT2LONG || opcode == MMCO_LONG2UNUSED ||
|
||||
opcode == MMCO_LONG || opcode == MMCO_SET_MAX_LONG) {
|
||||
unsigned int long_arg = get_ue_golomb_31(gb);
|
||||
if (long_arg >= 32 ||
|
||||
(long_arg >= 16 && !(opcode == MMCO_SET_MAX_LONG &&
|
||||
long_arg == 16) &&
|
||||
!(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE))){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR,
|
||||
"illegal long ref in memory management control "
|
||||
"operation %d\n", opcode);
|
||||
return -1;
|
||||
}
|
||||
mmco[i].long_arg = long_arg;
|
||||
}
|
||||
|
||||
if(opcode > (unsigned)MMCO_LONG){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR, "illegal memory management control operation %d\n", opcode);
|
||||
if (opcode > (unsigned) MMCO_LONG){
|
||||
av_log(h->s.avctx, AV_LOG_ERROR,
|
||||
"illegal memory management control operation %d\n",
|
||||
opcode);
|
||||
return -1;
|
||||
}
|
||||
if(opcode == MMCO_END)
|
||||
if (opcode == MMCO_END)
|
||||
break;
|
||||
}
|
||||
h->mmco_index= i;
|
||||
}else{
|
||||
ff_generate_sliding_window_mmcos(h);
|
||||
mmco_index = i;
|
||||
} else {
|
||||
if (first_slice) {
|
||||
ret = ff_generate_sliding_window_mmcos(h, first_slice);
|
||||
if (ret < 0 && s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return ret;
|
||||
}
|
||||
mmco_index = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (first_slice && mmco_index != -1) {
|
||||
h->mmco_index = mmco_index;
|
||||
} else if (!first_slice && mmco_index >= 0 &&
|
||||
(mmco_index != h->mmco_index ||
|
||||
(i = check_opcodes(h->mmco, mmco_temp, mmco_index)))) {
|
||||
av_log(h->s.avctx, AV_LOG_ERROR,
|
||||
"Inconsistent MMCO state between slices [%d, %d, %d]\n",
|
||||
mmco_index, h->mmco_index, i);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -118,12 +118,13 @@ static void generate_joint_tables(HYuvContext *s)
|
||||
for (i = y = 0; y < 256; y++) {
|
||||
int len0 = s->len[0][y];
|
||||
int limit = VLC_BITS - len0;
|
||||
if(limit <= 0)
|
||||
if(limit <= 0 || !len0)
|
||||
continue;
|
||||
for (u = 0; u < 256; u++) {
|
||||
int len1 = s->len[p][u];
|
||||
if (len1 > limit)
|
||||
if (len1 > limit || !len1)
|
||||
continue;
|
||||
av_assert0(i < (1 << VLC_BITS));
|
||||
len[i] = len0 + len1;
|
||||
bits[i] = (s->bits[0][y] << len1) + s->bits[p][u];
|
||||
symbols[i] = (y << 8) + u;
|
||||
@@ -146,18 +147,19 @@ static void generate_joint_tables(HYuvContext *s)
|
||||
for (i = 0, g = -16; g < 16; g++) {
|
||||
int len0 = s->len[p0][g & 255];
|
||||
int limit0 = VLC_BITS - len0;
|
||||
if (limit0 < 2)
|
||||
if (limit0 < 2 || !len0)
|
||||
continue;
|
||||
for (b = -16; b < 16; b++) {
|
||||
int len1 = s->len[p1][b & 255];
|
||||
int limit1 = limit0 - len1;
|
||||
if (limit1 < 1)
|
||||
if (limit1 < 1 || !len1)
|
||||
continue;
|
||||
code = (s->bits[p0][g & 255] << len1) + s->bits[p1][b & 255];
|
||||
for (r = -16; r < 16; r++) {
|
||||
int len2 = s->len[2][r & 255];
|
||||
if (len2 > limit1)
|
||||
if (len2 > limit1 || !len2)
|
||||
continue;
|
||||
av_assert0(i < (1 << VLC_BITS));
|
||||
len[i] = len0 + len1 + len2;
|
||||
bits[i] = (code << len2) + s->bits[2][r & 255];
|
||||
if (s->decorrelate) {
|
||||
@@ -182,6 +184,7 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)
|
||||
{
|
||||
GetBitContext gb;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
init_get_bits(&gb, src, length * 8);
|
||||
|
||||
@@ -192,8 +195,9 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)
|
||||
return -1;
|
||||
}
|
||||
ff_free_vlc(&s->vlc[i]);
|
||||
init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
|
||||
s->bits[i], 4, 4, 0);
|
||||
if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
|
||||
s->bits[i], 4, 4, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
generate_joint_tables(s);
|
||||
@@ -205,6 +209,7 @@ static int read_old_huffman_tables(HYuvContext *s)
|
||||
{
|
||||
GetBitContext gb;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
init_get_bits(&gb, classic_shift_luma,
|
||||
classic_shift_luma_table_size * 8);
|
||||
@@ -228,8 +233,9 @@ static int read_old_huffman_tables(HYuvContext *s)
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
ff_free_vlc(&s->vlc[i]);
|
||||
init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
|
||||
s->bits[i], 4, 4, 0);
|
||||
if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1,
|
||||
s->bits[i], 4, 4, 0)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
generate_joint_tables(s);
|
||||
|
@@ -341,7 +341,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
avctx->pix_fmt = AV_PIX_FMT_RGB444;
|
||||
} else if (avctx->codec_tag != MKTAG('D','E','E','P')) {
|
||||
if (avctx->bits_per_coded_sample == 24) {
|
||||
avctx->pix_fmt = AV_PIX_FMT_RGB0;
|
||||
avctx->pix_fmt = AV_PIX_FMT_0BGR32;
|
||||
} else if (avctx->bits_per_coded_sample == 32) {
|
||||
avctx->pix_fmt = AV_PIX_FMT_BGR32;
|
||||
} else {
|
||||
|
@@ -226,7 +226,7 @@ static av_cold void free_frame_buffers(Indeo3DecodeContext *ctx)
|
||||
* @param plane pointer to the plane descriptor
|
||||
* @param cell pointer to the cell descriptor
|
||||
*/
|
||||
static void copy_cell(Indeo3DecodeContext *ctx, Plane *plane, Cell *cell)
|
||||
static int copy_cell(Indeo3DecodeContext *ctx, Plane *plane, Cell *cell)
|
||||
{
|
||||
int h, w, mv_x, mv_y, offset, offset_dst;
|
||||
uint8_t *src, *dst;
|
||||
@@ -239,6 +239,16 @@ static void copy_cell(Indeo3DecodeContext *ctx, Plane *plane, Cell *cell)
|
||||
mv_x = cell->mv_ptr[1];
|
||||
}else
|
||||
mv_x= mv_y= 0;
|
||||
|
||||
/* -1 because there is an extra line on top for prediction */
|
||||
if ((cell->ypos << 2) + mv_y < -1 || (cell->xpos << 2) + mv_x < 0 ||
|
||||
((cell->ypos + cell->height) << 2) + mv_y > plane->height ||
|
||||
((cell->xpos + cell->width) << 2) + mv_x > plane->width) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR,
|
||||
"Motion vectors point out of the frame.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
offset = offset_dst + mv_y * plane->pitch + mv_x;
|
||||
src = plane->pixels[ctx->buf_sel ^ 1] + offset;
|
||||
|
||||
@@ -266,15 +276,17 @@ static void copy_cell(Indeo3DecodeContext *ctx, Plane *plane, Cell *cell)
|
||||
dst += 4;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Average 4/8 pixels at once without rounding using SWAR */
|
||||
#define AVG_32(dst, src, ref) \
|
||||
AV_WN32A(dst, ((AV_RN32A(src) + AV_RN32A(ref)) >> 1) & 0x7F7F7F7FUL)
|
||||
AV_WN32A(dst, ((AV_RN32(src) + AV_RN32(ref)) >> 1) & 0x7F7F7F7FUL)
|
||||
|
||||
#define AVG_64(dst, src, ref) \
|
||||
AV_WN64A(dst, ((AV_RN64A(src) + AV_RN64A(ref)) >> 1) & 0x7F7F7F7F7F7F7F7FULL)
|
||||
AV_WN64A(dst, ((AV_RN64(src) + AV_RN64(ref)) >> 1) & 0x7F7F7F7F7F7F7F7FULL)
|
||||
|
||||
|
||||
/*
|
||||
@@ -333,7 +345,7 @@ if (*data_ptr >= last_ptr) \
|
||||
copy_block4(dst, ref, row_offset, row_offset, 4 << v_zoom)
|
||||
|
||||
#define RLE_BLOCK_COPY_8 \
|
||||
pix64 = AV_RN64A(ref);\
|
||||
pix64 = AV_RN64(ref);\
|
||||
if (is_first_row) {/* special prediction case: top line of a cell */\
|
||||
pix64 = replicate64(pix64);\
|
||||
fill_64(dst + row_offset, pix64, 7, row_offset);\
|
||||
@@ -345,7 +357,7 @@ if (*data_ptr >= last_ptr) \
|
||||
copy_block4(dst, ref, row_offset, row_offset, num_lines << v_zoom)
|
||||
|
||||
#define RLE_LINES_COPY_M10 \
|
||||
pix64 = AV_RN64A(ref);\
|
||||
pix64 = AV_RN64(ref);\
|
||||
if (is_top_of_cell) {\
|
||||
pix64 = replicate64(pix64);\
|
||||
fill_64(dst + row_offset, pix64, (num_lines << 1) - 1, row_offset);\
|
||||
@@ -355,12 +367,12 @@ if (*data_ptr >= last_ptr) \
|
||||
|
||||
#define APPLY_DELTA_4 \
|
||||
AV_WN16A(dst + line_offset ,\
|
||||
(AV_RN16A(ref ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
|
||||
(AV_RN16(ref ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
|
||||
AV_WN16A(dst + line_offset + 2,\
|
||||
(AV_RN16A(ref + 2) + delta_tab->deltas[dyad2]) & 0x7F7F);\
|
||||
(AV_RN16(ref + 2) + delta_tab->deltas[dyad2]) & 0x7F7F);\
|
||||
if (mode >= 3) {\
|
||||
if (is_top_of_cell && !cell->ypos) {\
|
||||
AV_COPY32(dst, dst + row_offset);\
|
||||
AV_COPY32U(dst, dst + row_offset);\
|
||||
} else {\
|
||||
AVG_32(dst, ref, dst + row_offset);\
|
||||
}\
|
||||
@@ -370,20 +382,20 @@ if (*data_ptr >= last_ptr) \
|
||||
/* apply two 32-bit VQ deltas to next even line */\
|
||||
if (is_top_of_cell) { \
|
||||
AV_WN32A(dst + row_offset , \
|
||||
(replicate32(AV_RN32A(ref )) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
|
||||
(replicate32(AV_RN32(ref )) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
|
||||
AV_WN32A(dst + row_offset + 4, \
|
||||
(replicate32(AV_RN32A(ref + 4)) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
|
||||
(replicate32(AV_RN32(ref + 4)) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
|
||||
} else { \
|
||||
AV_WN32A(dst + row_offset , \
|
||||
(AV_RN32A(ref ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
|
||||
(AV_RN32(ref ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
|
||||
AV_WN32A(dst + row_offset + 4, \
|
||||
(AV_RN32A(ref + 4) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
|
||||
(AV_RN32(ref + 4) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
|
||||
} \
|
||||
/* odd lines are not coded but rather interpolated/replicated */\
|
||||
/* first line of the cell on the top of image? - replicate */\
|
||||
/* otherwise - interpolate */\
|
||||
if (is_top_of_cell && !cell->ypos) {\
|
||||
AV_COPY64(dst, dst + row_offset);\
|
||||
AV_COPY64U(dst, dst + row_offset);\
|
||||
} else \
|
||||
AVG_64(dst, ref, dst + row_offset);
|
||||
|
||||
@@ -391,22 +403,22 @@ if (*data_ptr >= last_ptr) \
|
||||
#define APPLY_DELTA_1011_INTER \
|
||||
if (mode == 10) { \
|
||||
AV_WN32A(dst , \
|
||||
(AV_RN32A(dst ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
|
||||
(AV_RN32(dst ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
|
||||
AV_WN32A(dst + 4 , \
|
||||
(AV_RN32A(dst + 4 ) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
|
||||
(AV_RN32(dst + 4 ) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
|
||||
AV_WN32A(dst + row_offset , \
|
||||
(AV_RN32A(dst + row_offset ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
|
||||
(AV_RN32(dst + row_offset ) + delta_tab->deltas_m10[dyad1]) & 0x7F7F7F7F);\
|
||||
AV_WN32A(dst + row_offset + 4, \
|
||||
(AV_RN32A(dst + row_offset + 4) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
|
||||
(AV_RN32(dst + row_offset + 4) + delta_tab->deltas_m10[dyad2]) & 0x7F7F7F7F);\
|
||||
} else { \
|
||||
AV_WN16A(dst , \
|
||||
(AV_RN16A(dst ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
|
||||
(AV_RN16(dst ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
|
||||
AV_WN16A(dst + 2 , \
|
||||
(AV_RN16A(dst + 2 ) + delta_tab->deltas[dyad2]) & 0x7F7F);\
|
||||
(AV_RN16(dst + 2 ) + delta_tab->deltas[dyad2]) & 0x7F7F);\
|
||||
AV_WN16A(dst + row_offset , \
|
||||
(AV_RN16A(dst + row_offset ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
|
||||
(AV_RN16(dst + row_offset ) + delta_tab->deltas[dyad1]) & 0x7F7F);\
|
||||
AV_WN16A(dst + row_offset + 2, \
|
||||
(AV_RN16A(dst + row_offset + 2) + delta_tab->deltas[dyad2]) & 0x7F7F);\
|
||||
(AV_RN16(dst + row_offset + 2) + delta_tab->deltas[dyad2]) & 0x7F7F);\
|
||||
}
|
||||
|
||||
|
||||
@@ -604,11 +616,23 @@ static int decode_cell(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
} else if (mode >= 10) {
|
||||
/* for mode 10 and 11 INTER first copy the predicted cell into the current one */
|
||||
/* so we don't need to do data copying for each RLE code later */
|
||||
copy_cell(ctx, plane, cell);
|
||||
int ret = copy_cell(ctx, plane, cell);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
} else {
|
||||
/* set the pointer to the reference pixels for modes 0-4 INTER */
|
||||
mv_y = cell->mv_ptr[0];
|
||||
mv_x = cell->mv_ptr[1];
|
||||
|
||||
/* -1 because there is an extra line on top for prediction */
|
||||
if ((cell->ypos << 2) + mv_y < -1 || (cell->xpos << 2) + mv_x < 0 ||
|
||||
((cell->ypos + cell->height) << 2) + mv_y > plane->height ||
|
||||
((cell->xpos + cell->width) << 2) + mv_x > plane->width) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR,
|
||||
"Motion vectors point out of the frame.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
offset += mv_y * plane->pitch + mv_x;
|
||||
ref_block = plane->pixels[ctx->buf_sel ^ 1] + offset;
|
||||
}
|
||||
@@ -740,8 +764,7 @@ static int parse_bintree(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
const int depth, const int strip_width)
|
||||
{
|
||||
Cell curr_cell;
|
||||
int bytes_used;
|
||||
int mv_x, mv_y;
|
||||
int bytes_used, ret;
|
||||
|
||||
if (depth <= 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Stack overflow (corrupted binary tree)!\n");
|
||||
@@ -792,19 +815,8 @@ static int parse_bintree(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
CHECK_CELL
|
||||
if (!curr_cell.mv_ptr)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
mv_y = curr_cell.mv_ptr[0];
|
||||
mv_x = curr_cell.mv_ptr[1];
|
||||
if ( mv_x + 4*curr_cell.xpos < 0
|
||||
|| mv_y + 4*curr_cell.ypos < 0
|
||||
|| mv_x + 4*curr_cell.xpos + 4*curr_cell.width > plane->width
|
||||
|| mv_y + 4*curr_cell.ypos + 4*curr_cell.height > plane->height) {
|
||||
av_log(avctx, AV_LOG_ERROR, "motion vector %d %d outside reference\n", mv_x + 4*curr_cell.xpos, mv_y + 4*curr_cell.ypos);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
copy_cell(ctx, plane, &curr_cell);
|
||||
return 0;
|
||||
ret = copy_cell(ctx, plane, &curr_cell);
|
||||
return ret;
|
||||
}
|
||||
break;
|
||||
case INTER_DATA:
|
||||
@@ -891,17 +903,20 @@ static int decode_plane(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
const uint8_t *buf_ptr = buf, *bs_hdr;
|
||||
GetByteContext gb;
|
||||
const uint8_t *bs_hdr;
|
||||
uint32_t frame_num, word2, check_sum, data_size;
|
||||
uint32_t y_offset, u_offset, v_offset, starts[3], ends[3];
|
||||
uint16_t height, width;
|
||||
int i, j;
|
||||
|
||||
bytestream2_init(&gb, buf, buf_size);
|
||||
|
||||
/* parse and check the OS header */
|
||||
frame_num = bytestream_get_le32(&buf_ptr);
|
||||
word2 = bytestream_get_le32(&buf_ptr);
|
||||
check_sum = bytestream_get_le32(&buf_ptr);
|
||||
data_size = bytestream_get_le32(&buf_ptr);
|
||||
frame_num = bytestream2_get_le32(&gb);
|
||||
word2 = bytestream2_get_le32(&gb);
|
||||
check_sum = bytestream2_get_le32(&gb);
|
||||
data_size = bytestream2_get_le32(&gb);
|
||||
|
||||
if ((frame_num ^ word2 ^ data_size ^ OS_HDR_ID) != check_sum) {
|
||||
av_log(avctx, AV_LOG_ERROR, "OS header checksum mismatch!\n");
|
||||
@@ -909,29 +924,27 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
/* parse the bitstream header */
|
||||
bs_hdr = buf_ptr;
|
||||
buf_size -= 16;
|
||||
bs_hdr = gb.buffer;
|
||||
|
||||
if (bytestream_get_le16(&buf_ptr) != 32) {
|
||||
if (bytestream2_get_le16(&gb) != 32) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unsupported codec version!\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
ctx->frame_num = frame_num;
|
||||
ctx->frame_flags = bytestream_get_le16(&buf_ptr);
|
||||
ctx->data_size = (bytestream_get_le32(&buf_ptr) + 7) >> 3;
|
||||
ctx->cb_offset = *buf_ptr++;
|
||||
ctx->frame_flags = bytestream2_get_le16(&gb);
|
||||
ctx->data_size = (bytestream2_get_le32(&gb) + 7) >> 3;
|
||||
ctx->cb_offset = bytestream2_get_byte(&gb);
|
||||
|
||||
if (ctx->data_size == 16)
|
||||
return 4;
|
||||
if (ctx->data_size > buf_size)
|
||||
ctx->data_size = buf_size;
|
||||
ctx->data_size = FFMIN(ctx->data_size, buf_size - 16);
|
||||
|
||||
buf_ptr += 3; // skip reserved byte and checksum
|
||||
bytestream2_skip(&gb, 3); // skip reserved byte and checksum
|
||||
|
||||
/* check frame dimensions */
|
||||
height = bytestream_get_le16(&buf_ptr);
|
||||
width = bytestream_get_le16(&buf_ptr);
|
||||
height = bytestream2_get_le16(&gb);
|
||||
width = bytestream2_get_le16(&gb);
|
||||
if (av_image_check_size(width, height, 0, avctx))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
@@ -953,9 +966,10 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
avcodec_set_dimensions(avctx, width, height);
|
||||
}
|
||||
|
||||
y_offset = bytestream_get_le32(&buf_ptr);
|
||||
v_offset = bytestream_get_le32(&buf_ptr);
|
||||
u_offset = bytestream_get_le32(&buf_ptr);
|
||||
y_offset = bytestream2_get_le32(&gb);
|
||||
v_offset = bytestream2_get_le32(&gb);
|
||||
u_offset = bytestream2_get_le32(&gb);
|
||||
bytestream2_skip(&gb, 4);
|
||||
|
||||
/* unfortunately there is no common order of planes in the buffer */
|
||||
/* so we use that sorting algo for determining planes data sizes */
|
||||
@@ -974,6 +988,7 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
ctx->v_data_size = ends[1] - starts[1];
|
||||
ctx->u_data_size = ends[2] - starts[2];
|
||||
if (FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 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) {
|
||||
av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -982,7 +997,7 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
||||
ctx->y_data_ptr = bs_hdr + y_offset;
|
||||
ctx->v_data_ptr = bs_hdr + v_offset;
|
||||
ctx->u_data_ptr = bs_hdr + u_offset;
|
||||
ctx->alt_quant = buf_ptr + sizeof(uint32_t);
|
||||
ctx->alt_quant = gb.buffer;
|
||||
|
||||
if (ctx->data_size == 16) {
|
||||
av_log(avctx, AV_LOG_DEBUG, "Sync frame encountered!\n");
|
||||
|
@@ -16,9 +16,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#include <libavutil/avassert.h>
|
||||
#include <libavutil/mathematics.h>
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "kbdwin.h"
|
||||
|
||||
|
@@ -107,6 +107,9 @@ static inline uint8_t lag_get_rac(lag_rac *l)
|
||||
l->range -= range_scaled * l->prob[255];
|
||||
}
|
||||
|
||||
if (!l->range)
|
||||
l->range = 0x80;
|
||||
|
||||
l->low -= range_scaled * l->prob[val];
|
||||
|
||||
return val;
|
||||
|
@@ -199,7 +199,7 @@ static int Faac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
|
||||
/* add current frame to the queue */
|
||||
if (frame) {
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -334,7 +334,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
in_buf.bufElSizes = &in_buffer_element_size;
|
||||
|
||||
/* add current frame to the queue */
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -218,7 +218,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
}
|
||||
} else {
|
||||
lame_result = lame_encode_flush(s->gfp, s->buffer + s->buffer_index,
|
||||
BUFFER_SIZE - s->buffer_index);
|
||||
s->buffer_size - s->buffer_index);
|
||||
}
|
||||
if (lame_result < 0) {
|
||||
if (lame_result == -1) {
|
||||
@@ -237,7 +237,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
|
||||
/* add current frame to the queue */
|
||||
if (frame) {
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -50,41 +50,6 @@ static int amr_decode_fix_avctx(AVCodecContext *avctx)
|
||||
#include <opencore-amrnb/interf_dec.h>
|
||||
#include <opencore-amrnb/interf_enc.h>
|
||||
|
||||
/* Common code for fixed and float version*/
|
||||
typedef struct AMR_bitrates {
|
||||
int rate;
|
||||
enum Mode mode;
|
||||
} AMR_bitrates;
|
||||
|
||||
/* Match desired bitrate */
|
||||
static int get_bitrate_mode(int bitrate, void *log_ctx)
|
||||
{
|
||||
/* make the correspondance between bitrate and mode */
|
||||
static const AMR_bitrates rates[] = {
|
||||
{ 4750, MR475 }, { 5150, MR515 }, { 5900, MR59 }, { 6700, MR67 },
|
||||
{ 7400, MR74 }, { 7950, MR795 }, { 10200, MR102 }, { 12200, MR122 }
|
||||
};
|
||||
int i, best = -1, min_diff = 0;
|
||||
char log_buf[200];
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (rates[i].rate == bitrate)
|
||||
return rates[i].mode;
|
||||
if (best < 0 || abs(rates[i].rate - bitrate) < min_diff) {
|
||||
best = i;
|
||||
min_diff = abs(rates[i].rate - bitrate);
|
||||
}
|
||||
}
|
||||
/* no bitrate matching exactly, log a warning */
|
||||
snprintf(log_buf, sizeof(log_buf), "bitrate not supported: use one of ");
|
||||
for (i = 0; i < 8; i++)
|
||||
av_strlcatf(log_buf, sizeof(log_buf), "%.2fk, ", rates[i].rate / 1000.f);
|
||||
av_strlcatf(log_buf, sizeof(log_buf), "using %.2fk", rates[best].rate / 1000.f);
|
||||
av_log(log_ctx, AV_LOG_WARNING, "%s\n", log_buf);
|
||||
|
||||
return best;
|
||||
}
|
||||
|
||||
typedef struct AMRContext {
|
||||
AVClass *av_class;
|
||||
AVFrame frame;
|
||||
@@ -97,15 +62,7 @@ typedef struct AMRContext {
|
||||
AudioFrameQueue afq;
|
||||
} AMRContext;
|
||||
|
||||
static const AVOption options[] = {
|
||||
{ "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRContext, enc_dtx), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static const AVClass class = {
|
||||
"libopencore_amrnb", av_default_item_name, options, LIBAVUTIL_VERSION_INT
|
||||
};
|
||||
|
||||
#if CONFIG_LIBOPENCORE_AMRNB_DECODER
|
||||
static av_cold int amr_nb_decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
AMRContext *s = avctx->priv_data;
|
||||
@@ -186,6 +143,52 @@ AVCodec ff_libopencore_amrnb_decoder = {
|
||||
.capabilities = CODEC_CAP_DR1,
|
||||
.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"),
|
||||
};
|
||||
#endif /* CONFIG_LIBOPENCORE_AMRNB_DECODER */
|
||||
|
||||
#if CONFIG_LIBOPENCORE_AMRNB_ENCODER
|
||||
/* Common code for fixed and float version*/
|
||||
typedef struct AMR_bitrates {
|
||||
int rate;
|
||||
enum Mode mode;
|
||||
} AMR_bitrates;
|
||||
|
||||
/* Match desired bitrate */
|
||||
static int get_bitrate_mode(int bitrate, void *log_ctx)
|
||||
{
|
||||
/* make the correspondance between bitrate and mode */
|
||||
static const AMR_bitrates rates[] = {
|
||||
{ 4750, MR475 }, { 5150, MR515 }, { 5900, MR59 }, { 6700, MR67 },
|
||||
{ 7400, MR74 }, { 7950, MR795 }, { 10200, MR102 }, { 12200, MR122 }
|
||||
};
|
||||
int i, best = -1, min_diff = 0;
|
||||
char log_buf[200];
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (rates[i].rate == bitrate)
|
||||
return rates[i].mode;
|
||||
if (best < 0 || abs(rates[i].rate - bitrate) < min_diff) {
|
||||
best = i;
|
||||
min_diff = abs(rates[i].rate - bitrate);
|
||||
}
|
||||
}
|
||||
/* no bitrate matching exactly, log a warning */
|
||||
snprintf(log_buf, sizeof(log_buf), "bitrate not supported: use one of ");
|
||||
for (i = 0; i < 8; i++)
|
||||
av_strlcatf(log_buf, sizeof(log_buf), "%.2fk, ", rates[i].rate / 1000.f);
|
||||
av_strlcatf(log_buf, sizeof(log_buf), "using %.2fk", rates[best].rate / 1000.f);
|
||||
av_log(log_ctx, AV_LOG_WARNING, "%s\n", log_buf);
|
||||
|
||||
return best;
|
||||
}
|
||||
|
||||
static const AVOption options[] = {
|
||||
{ "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRContext, enc_dtx), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static const AVClass class = {
|
||||
"libopencore_amrnb", av_default_item_name, options, LIBAVUTIL_VERSION_INT
|
||||
};
|
||||
|
||||
static av_cold int amr_nb_encode_init(AVCodecContext *avctx)
|
||||
{
|
||||
@@ -261,7 +264,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
if (frame->nb_samples < avctx->frame_size - avctx->delay)
|
||||
s->enc_last_frame = -1;
|
||||
}
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame) < 0)) {
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame)) < 0) {
|
||||
av_freep(&flush_buf);
|
||||
return ret;
|
||||
}
|
||||
@@ -304,11 +307,12 @@ AVCodec ff_libopencore_amrnb_encoder = {
|
||||
.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-NB (Adaptive Multi-Rate Narrow-Band)"),
|
||||
.priv_class = &class,
|
||||
};
|
||||
#endif /* CONFIG_LIBOPENCORE_AMRNB_ENCODER */
|
||||
|
||||
#endif
|
||||
#endif /* CONFIG_LIBOPENCORE_AMRNB */
|
||||
|
||||
/* -----------AMR wideband ------------*/
|
||||
#if CONFIG_LIBOPENCORE_AMRWB
|
||||
#if CONFIG_LIBOPENCORE_AMRWB_DECODER
|
||||
|
||||
#include <opencore-amrwb/dec_if.h>
|
||||
#include <opencore-amrwb/if_rom.h>
|
||||
@@ -392,4 +396,4 @@ AVCodec ff_libopencore_amrwb_decoder = {
|
||||
.long_name = NULL_IF_CONFIG_SMALL("OpenCORE AMR-WB (Adaptive Multi-Rate Wide-Band)"),
|
||||
};
|
||||
|
||||
#endif /* CONFIG_LIBOPENCORE_AMRWB */
|
||||
#endif /* CONFIG_LIBOPENCORE_AMRWB_DECODER */
|
||||
|
@@ -288,7 +288,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
speex_encode_stereo_int(samples, s->header.frame_size, &s->bits);
|
||||
speex_encode_int(s->enc_state, samples, &s->bits);
|
||||
s->pkt_frame_count++;
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
|
||||
return ret;
|
||||
} else {
|
||||
/* handle end-of-stream */
|
||||
|
@@ -157,7 +157,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
samples = (VO_PBYTE)frame->data[0];
|
||||
}
|
||||
/* add current frame to the queue */
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -305,7 +305,7 @@ static int oggvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
av_log(avctx, AV_LOG_ERROR, "error in vorbis_analysis_wrote()\n");
|
||||
return vorbis_error_to_averror(ret);
|
||||
}
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
|
||||
return ret;
|
||||
} else {
|
||||
if (!s->eof)
|
||||
|
@@ -174,7 +174,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
|
||||
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
|
||||
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
|
||||
X264_TYPE_AUTO;
|
||||
if (x4->params.b_tff != frame->top_field_first) {
|
||||
if (x4->params.b_interlaced && x4->params.b_tff != frame->top_field_first) {
|
||||
x4->params.b_tff = frame->top_field_first;
|
||||
x264_encoder_reconfig(x4->enc, &x4->params);
|
||||
}
|
||||
@@ -335,7 +335,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
|
||||
x4->params.rc.f_rf_constant_max = x4->crf_max;
|
||||
}
|
||||
|
||||
if (avctx->rc_buffer_size && avctx->rc_initial_buffer_occupancy &&
|
||||
if (avctx->rc_buffer_size && avctx->rc_initial_buffer_occupancy > 0 &&
|
||||
(avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) {
|
||||
x4->params.rc.f_vbv_buffer_init =
|
||||
(float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size;
|
||||
@@ -695,6 +695,7 @@ static const AVCodecDefault x264_defaults[] = {
|
||||
{ "threads", AV_STRINGIFY(X264_THREADS_AUTO) },
|
||||
{ "thread_type", "0" },
|
||||
{ "flags", "+cgop" },
|
||||
{ "rc_init_occupancy","-1" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
@@ -57,6 +57,13 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
|
||||
max_pkt_size += mb_width * mb_height * 3 * 4
|
||||
* s->mjpeg_hsample[0] * s->mjpeg_vsample[0];
|
||||
}
|
||||
|
||||
if (!s->edge_emu_buffer &&
|
||||
(ret = ff_mpv_frame_size_alloc(s, pict->linesize[0])) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "failed to allocate context scratch buffers.\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, max_pkt_size)) < 0)
|
||||
return ret;
|
||||
|
||||
|
@@ -181,7 +181,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
p->key_frame = 1;
|
||||
|
||||
#define ADVANCE_BY_DECODED do { \
|
||||
if (decoded < 0) goto stop; \
|
||||
if (decoded < 0 || decoded >= buf_size) goto buf_too_small; \
|
||||
buf += decoded; buf_size -= decoded; \
|
||||
} while(0)
|
||||
switch(l->mode) {
|
||||
@@ -215,7 +215,8 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
decoded = loco_decode_plane(l, p->data[0] + p->linesize[0]*(avctx->height-1) + 2, avctx->width, avctx->height,
|
||||
-p->linesize[0], buf, buf_size, 3);
|
||||
break;
|
||||
case LOCO_CRGBA: case LOCO_RGBA:
|
||||
case LOCO_CRGBA:
|
||||
case LOCO_RGBA:
|
||||
decoded = loco_decode_plane(l, p->data[0] + p->linesize[0]*(avctx->height-1), avctx->width, avctx->height,
|
||||
-p->linesize[0], buf, buf_size, 4);
|
||||
ADVANCE_BY_DECODED;
|
||||
@@ -229,15 +230,18 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
-p->linesize[0], buf, buf_size, 4);
|
||||
break;
|
||||
}
|
||||
stop:
|
||||
|
||||
*got_frame = 1;
|
||||
*(AVFrame*)data = l->pic;
|
||||
|
||||
return buf_size < 0 ? -1 : avpkt->size - buf_size;
|
||||
buf_too_small:
|
||||
av_log(avctx, AV_LOG_ERROR, "Input data too small.\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
static av_cold int decode_init(AVCodecContext *avctx){
|
||||
static av_cold int decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
LOCOContext * const l = avctx->priv_data;
|
||||
int version;
|
||||
|
||||
|
@@ -740,7 +740,9 @@ static void handle_rstn(MJpegDecodeContext *s, int nb_components)
|
||||
|
||||
i = 8 + ((-get_bits_count(&s->gb)) & 7);
|
||||
/* skip RSTn */
|
||||
if (s->restart_count == 0 && show_bits(&s->gb, i) == (1 << i) - 1) {
|
||||
if (s->restart_count == 0) {
|
||||
if( show_bits(&s->gb, i) == (1 << i) - 1
|
||||
|| show_bits(&s->gb, i) == 0xFF) {
|
||||
int pos = get_bits_count(&s->gb);
|
||||
align_get_bits(&s->gb);
|
||||
while (get_bits_left(&s->gb) >= 8 && show_bits(&s->gb, 8) == 0xFF)
|
||||
@@ -750,6 +752,7 @@ static void handle_rstn(MJpegDecodeContext *s, int nb_components)
|
||||
s->last_dc[i] = 1024;
|
||||
} else
|
||||
skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1630,6 +1633,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
MJpegDecodeContext *s = avctx->priv_data;
|
||||
const uint8_t *buf_end, *buf_ptr;
|
||||
const uint8_t *unescaped_buf_ptr;
|
||||
int hshift, vshift;
|
||||
int unescaped_buf_size;
|
||||
int start_code;
|
||||
int i, index;
|
||||
@@ -1808,6 +1812,9 @@ the_end:
|
||||
}
|
||||
if (s->upscale_v) {
|
||||
uint8_t *dst = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(s->height - 1) * s->linesize[s->upscale_v]];
|
||||
int w;
|
||||
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
|
||||
w = s->width >> hshift;
|
||||
av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
|
||||
avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
|
||||
avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
|
||||
@@ -1816,16 +1823,16 @@ the_end:
|
||||
uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[i / 2 * s->linesize[s->upscale_v]];
|
||||
uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(i + 1) / 2 * s->linesize[s->upscale_v]];
|
||||
if (src1 == src2) {
|
||||
memcpy(dst, src1, s->width);
|
||||
memcpy(dst, src1, w);
|
||||
} else {
|
||||
for (index = 0; index < s->width; index++)
|
||||
for (index = 0; index < w; index++)
|
||||
dst[index] = (src1[index] + src2[index]) >> 1;
|
||||
}
|
||||
dst -= s->linesize[s->upscale_v];
|
||||
}
|
||||
}
|
||||
if (s->flipped && (s->avctx->flags & CODEC_FLAG_EMU_EDGE)) {
|
||||
int hshift, vshift, j;
|
||||
int j;
|
||||
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
|
||||
for (index=0; index<4; index++) {
|
||||
uint8_t *dst = s->picture_ptr->data[index];
|
||||
|
@@ -126,7 +126,7 @@ uint64_t ff_truehd_layout(int chanmap)
|
||||
|
||||
int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
|
||||
{
|
||||
int ratebits;
|
||||
int ratebits, channel_arrangement;
|
||||
uint16_t checksum;
|
||||
|
||||
av_assert1(get_bits_count(gb) == 0);
|
||||
@@ -157,7 +157,10 @@ int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
|
||||
|
||||
skip_bits(gb, 11);
|
||||
|
||||
mh->channels_mlp = get_bits(gb, 5);
|
||||
mh->channel_arrangement=
|
||||
channel_arrangement = get_bits(gb, 5);
|
||||
mh->channels_mlp = mlp_channels[channel_arrangement];
|
||||
mh->channel_layout_mlp = ff_mlp_layout[channel_arrangement];
|
||||
} else if (mh->stream_type == 0xba) {
|
||||
mh->group1_bits = 24; // TODO: Is this information actually conveyed anywhere?
|
||||
mh->group2_bits = 0;
|
||||
@@ -168,11 +171,16 @@ int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
|
||||
|
||||
skip_bits(gb, 8);
|
||||
|
||||
mh->channels_thd_stream1 = get_bits(gb, 5);
|
||||
mh->channel_arrangement=
|
||||
channel_arrangement = get_bits(gb, 5);
|
||||
mh->channels_thd_stream1 = truehd_channels(channel_arrangement);
|
||||
mh->channel_layout_thd_stream1 = ff_truehd_layout(channel_arrangement);
|
||||
|
||||
skip_bits(gb, 2);
|
||||
|
||||
mh->channels_thd_stream2 = get_bits(gb, 13);
|
||||
channel_arrangement = get_bits(gb, 13);
|
||||
mh->channels_thd_stream2 = truehd_channels(channel_arrangement);
|
||||
mh->channel_layout_thd_stream2 = ff_truehd_layout(channel_arrangement);
|
||||
} else
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
@@ -322,16 +330,16 @@ static int mlp_parse(AVCodecParserContext *s,
|
||||
if(!avctx->channels || !avctx->channel_layout) {
|
||||
if (mh.stream_type == 0xbb) {
|
||||
/* MLP stream */
|
||||
avctx->channels = mlp_channels[mh.channels_mlp];
|
||||
avctx->channel_layout = ff_mlp_layout[mh.channels_mlp];
|
||||
avctx->channels = mh.channels_mlp;
|
||||
avctx->channel_layout = mh.channel_layout_mlp;
|
||||
} else { /* mh.stream_type == 0xba */
|
||||
/* TrueHD stream */
|
||||
if (mh.channels_thd_stream2) {
|
||||
avctx->channels = truehd_channels(mh.channels_thd_stream2);
|
||||
avctx->channel_layout = ff_truehd_layout(mh.channels_thd_stream2);
|
||||
avctx->channels = mh.channels_thd_stream2;
|
||||
avctx->channel_layout = mh.channel_layout_thd_stream2;
|
||||
} else {
|
||||
avctx->channels = truehd_channels(mh.channels_thd_stream1);
|
||||
avctx->channel_layout = ff_truehd_layout(mh.channels_thd_stream1);
|
||||
avctx->channels = mh.channels_thd_stream1;
|
||||
avctx->channel_layout = mh.channel_layout_thd_stream1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -39,9 +39,13 @@ typedef struct MLPHeaderInfo
|
||||
int group1_samplerate; ///< Sample rate of first substream
|
||||
int group2_samplerate; ///< Sample rate of second substream (MLP only)
|
||||
|
||||
int channels_mlp; ///< Channel arrangement for MLP streams
|
||||
int channels_thd_stream1; ///< Channel arrangement for substream 1 of TrueHD streams (5.1)
|
||||
int channels_thd_stream2; ///< Channel arrangement for substream 2 of TrueHD streams (7.1)
|
||||
int channel_arrangement;
|
||||
int channels_mlp; ///< Channel count for MLP streams
|
||||
int channels_thd_stream1; ///< Channel count for substream 1 of TrueHD streams ("6-channel presentation")
|
||||
int channels_thd_stream2; ///< Channel count for substream 2 of TrueHD streams ("8-channel presentation")
|
||||
uint64_t channel_layout_mlp; ///< Channel layout for MLP streams
|
||||
uint64_t channel_layout_thd_stream1; ///< Channel layout for substream 1 of TrueHD streams ("6-channel presentation")
|
||||
uint64_t channel_layout_thd_stream2; ///< Channel layout for substream 2 of TrueHD streams ("8-channel presentation")
|
||||
|
||||
int access_unit_size; ///< Number of samples per coded frame
|
||||
int access_unit_size_pow2; ///< Next power of two above number of samples per frame
|
||||
|
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "get_bits.h"
|
||||
#include "internal.h"
|
||||
#include "libavutil/crc.h"
|
||||
@@ -56,6 +57,8 @@ typedef struct SubStream {
|
||||
uint8_t max_matrix_channel;
|
||||
/// For each channel output by the matrix, the output channel to map it to
|
||||
uint8_t ch_assign[MAX_CHANNELS];
|
||||
/// The channel layout for this substream
|
||||
uint64_t ch_layout;
|
||||
|
||||
/// Channel coding parameters for channels in the substream
|
||||
ChannelParams channel_params[MAX_CHANNELS];
|
||||
@@ -149,6 +152,36 @@ typedef struct MLPDecodeContext {
|
||||
MLPDSPContext dsp;
|
||||
} MLPDecodeContext;
|
||||
|
||||
static const uint64_t thd_channel_order[] = {
|
||||
AV_CH_FRONT_LEFT, AV_CH_FRONT_RIGHT, // LR
|
||||
AV_CH_FRONT_CENTER, // C
|
||||
AV_CH_LOW_FREQUENCY, // LFE
|
||||
AV_CH_SIDE_LEFT, AV_CH_SIDE_RIGHT, // LRs
|
||||
AV_CH_TOP_FRONT_LEFT, AV_CH_TOP_FRONT_RIGHT, // LRvh
|
||||
AV_CH_FRONT_LEFT_OF_CENTER, AV_CH_FRONT_RIGHT_OF_CENTER, // LRc
|
||||
AV_CH_BACK_LEFT, AV_CH_BACK_RIGHT, // LRrs
|
||||
AV_CH_BACK_CENTER, // Cs
|
||||
AV_CH_TOP_CENTER, // Ts
|
||||
AV_CH_SURROUND_DIRECT_LEFT, AV_CH_SURROUND_DIRECT_RIGHT, // LRsd
|
||||
AV_CH_WIDE_LEFT, AV_CH_WIDE_RIGHT, // LRw
|
||||
AV_CH_TOP_FRONT_CENTER, // Cvh
|
||||
AV_CH_LOW_FREQUENCY_2, // LFE2
|
||||
};
|
||||
|
||||
static uint64_t thd_channel_layout_extract_channel(uint64_t channel_layout,
|
||||
int index)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (av_get_channel_layout_nb_channels(channel_layout) <= index)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(thd_channel_order); i++)
|
||||
if (channel_layout & thd_channel_order[i] && !index--)
|
||||
return thd_channel_order[i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
static VLC huff_vlc[3];
|
||||
|
||||
/** Initialize static data, constant between all invocations of the codec. */
|
||||
@@ -328,31 +361,32 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
|
||||
for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
|
||||
m->substream[substr].restart_seen = 0;
|
||||
|
||||
if (mh.stream_type == 0xbb) {
|
||||
/* MLP stream */
|
||||
m->avctx->channel_layout = ff_mlp_layout[mh.channels_mlp];
|
||||
} else { /* mh.stream_type == 0xba */
|
||||
/* TrueHD stream */
|
||||
if (mh.channels_thd_stream2) {
|
||||
m->avctx->channel_layout = ff_truehd_layout(mh.channels_thd_stream2);
|
||||
} else {
|
||||
m->avctx->channel_layout = ff_truehd_layout(mh.channels_thd_stream1);
|
||||
}
|
||||
if (m->avctx->channels<=2 && m->avctx->channel_layout == AV_CH_LAYOUT_MONO && m->max_decoded_substream == 1) {
|
||||
/* Set the layout for each substream. When there's more than one, the first
|
||||
* substream is Stereo. Subsequent substreams' layouts are indicated in the
|
||||
* major sync. */
|
||||
if (m->avctx->codec_id == AV_CODEC_ID_MLP) {
|
||||
if ((substr = (mh.num_substreams > 1)))
|
||||
m->substream[0].ch_layout = AV_CH_LAYOUT_STEREO;
|
||||
m->substream[substr].ch_layout = mh.channel_layout_mlp;
|
||||
} else {
|
||||
if ((substr = (mh.num_substreams > 1)))
|
||||
m->substream[0].ch_layout = AV_CH_LAYOUT_STEREO;
|
||||
if (mh.num_substreams > 2)
|
||||
if (mh.channel_layout_thd_stream2)
|
||||
m->substream[2].ch_layout = mh.channel_layout_thd_stream2;
|
||||
else
|
||||
m->substream[2].ch_layout = mh.channel_layout_thd_stream1;
|
||||
m->substream[substr].ch_layout = mh.channel_layout_thd_stream1;
|
||||
|
||||
if (m->avctx->channels<=2 && m->substream[substr].ch_layout == AV_CH_LAYOUT_MONO && m->max_decoded_substream == 1) {
|
||||
av_log(m->avctx, AV_LOG_DEBUG, "Mono stream with 2 substreams, ignoring 2nd\n");
|
||||
m->max_decoded_substream = 0;
|
||||
if (m->avctx->channels==2)
|
||||
m->avctx->channel_layout = AV_CH_LAYOUT_STEREO;
|
||||
}
|
||||
if (m->avctx->channels &&
|
||||
!m->avctx->request_channels && !m->avctx->request_channel_layout &&
|
||||
av_get_channel_layout_nb_channels(m->avctx->channel_layout) != m->avctx->channels) {
|
||||
m->avctx->channel_layout = 0;
|
||||
av_log_ask_for_sample(m->avctx, "Unknown channel layout.");
|
||||
}
|
||||
}
|
||||
|
||||
m->needs_reordering = mh.channels_mlp >= 18 && mh.channels_mlp <= 20;
|
||||
m->needs_reordering = mh.channel_arrangement >= 18 && mh.channel_arrangement <= 20;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -460,6 +494,12 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
|
||||
|
||||
for (ch = 0; ch <= s->max_matrix_channel; ch++) {
|
||||
int ch_assign = get_bits(gbp, 6);
|
||||
if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD) {
|
||||
uint64_t channel = thd_channel_layout_extract_channel(s->ch_layout,
|
||||
ch_assign);
|
||||
ch_assign = av_get_channel_layout_channel_index(s->ch_layout,
|
||||
channel);
|
||||
}
|
||||
if (ch_assign > s->max_matrix_channel) {
|
||||
av_log_ask_for_sample(m->avctx,
|
||||
"Assignment of matrix channel %d to invalid output channel %d.\n",
|
||||
@@ -481,20 +521,6 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
|
||||
FFSWAP(int, s->ch_assign[3], s->ch_assign[5]);
|
||||
}
|
||||
}
|
||||
if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD &&
|
||||
(m->avctx->channel_layout == AV_CH_LAYOUT_7POINT1 ||
|
||||
m->avctx->channel_layout == AV_CH_LAYOUT_7POINT1_WIDE)) {
|
||||
FFSWAP(int, s->ch_assign[4], s->ch_assign[6]);
|
||||
FFSWAP(int, s->ch_assign[5], s->ch_assign[7]);
|
||||
} else if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD &&
|
||||
(m->avctx->channel_layout == AV_CH_LAYOUT_6POINT1 ||
|
||||
m->avctx->channel_layout == (AV_CH_LAYOUT_6POINT1 | AV_CH_TOP_CENTER) ||
|
||||
m->avctx->channel_layout == (AV_CH_LAYOUT_6POINT1 | AV_CH_TOP_FRONT_CENTER))) {
|
||||
int i = s->ch_assign[6];
|
||||
s->ch_assign[6] = s->ch_assign[5];
|
||||
s->ch_assign[5] = s->ch_assign[4];
|
||||
s->ch_assign[4] = i;
|
||||
}
|
||||
|
||||
checksum = ff_mlp_restart_checksum(buf, get_bits_count(gbp) - start_count);
|
||||
|
||||
@@ -524,10 +550,9 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
|
||||
cp->huff_lsbs = 24;
|
||||
}
|
||||
|
||||
if (substr == m->max_decoded_substream &&
|
||||
m->avctx->channels != s->max_matrix_channel + 1) {
|
||||
m->avctx->channels = s->max_matrix_channel + 1;
|
||||
m->avctx->channel_layout = 0;
|
||||
if (substr == m->max_decoded_substream) {
|
||||
m->avctx->channels = s->max_matrix_channel + 1;
|
||||
m->avctx->channel_layout = s->ch_layout;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -720,6 +745,7 @@ static int read_channel_params(MLPDecodeContext *m, unsigned int substr,
|
||||
|
||||
if (cp->huff_lsbs > 24) {
|
||||
av_log(m->avctx, AV_LOG_ERROR, "Invalid huff_lsbs.\n");
|
||||
cp->huff_lsbs = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -983,6 +1009,11 @@ static int output_data(MLPDecodeContext *m, unsigned int substr,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (!s->blockpos) {
|
||||
av_log(avctx, AV_LOG_ERROR, "No samples to output.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
m->frame.nb_samples = s->blockpos;
|
||||
if ((ret = ff_get_buffer(avctx, &m->frame)) < 0) {
|
||||
|
@@ -104,6 +104,9 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
|
||||
if (half_horiz)
|
||||
run_length *=2;
|
||||
|
||||
if (run_length > s->avctx->width - x)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (color) {
|
||||
memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
|
||||
if (half_vert)
|
||||
@@ -151,6 +154,8 @@ static int mm_decode_inter(MmContext * s, int half_horiz, int half_vert)
|
||||
int replace_array = bytestream2_get_byte(&s->gb);
|
||||
for(j=0; j<8; j++) {
|
||||
int replace = (replace_array >> (7-j)) & 1;
|
||||
if (x + half_horiz >= s->avctx->width)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (replace) {
|
||||
int color = bytestream2_get_byte(&data_ptr);
|
||||
s->frame.data[0][y*s->frame.linesize[0] + x] = color;
|
||||
|
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "avcodec.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "ass_split.h"
|
||||
@@ -87,15 +88,18 @@ static av_cold int mov_text_encode_init(AVCodecContext *avctx)
|
||||
static void mov_text_text_cb(void *priv, const char *text, int len)
|
||||
{
|
||||
MovTextContext *s = priv;
|
||||
av_assert0(s->end >= s->ptr);
|
||||
av_strlcpy(s->ptr, text, FFMIN(s->end - s->ptr, len + 1));
|
||||
s->ptr += len;
|
||||
s->ptr += FFMIN(s->end - s->ptr, len);
|
||||
}
|
||||
|
||||
static void mov_text_new_line_cb(void *priv, int forced)
|
||||
{
|
||||
MovTextContext *s = priv;
|
||||
av_assert0(s->end >= s->ptr);
|
||||
av_strlcpy(s->ptr, "\n", FFMIN(s->end - s->ptr, 2));
|
||||
s->ptr++;
|
||||
if (s->end > s->ptr)
|
||||
s->ptr++;
|
||||
}
|
||||
|
||||
static const ASSCodesCallbacks mov_text_callbacks = {
|
||||
|
@@ -2001,8 +2001,6 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
|
||||
|
||||
width = get_bits(&s->gb, 12);
|
||||
height = get_bits(&s->gb, 12);
|
||||
if (width <= 0 || height <= 0)
|
||||
return -1;
|
||||
s->aspect_ratio_info = get_bits(&s->gb, 4);
|
||||
if (s->aspect_ratio_info == 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "aspect ratio has forbidden 0 value\n");
|
||||
@@ -2312,6 +2310,11 @@ static int decode_chunks(AVCodecContext *avctx,
|
||||
break;
|
||||
|
||||
case PICTURE_START_CODE:
|
||||
if (s2->width <= 0 || s2->height <= 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "%dx%d is invalid\n", s2->width, s2->height);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if(s->tmpgexs){
|
||||
s2->intra_dc_precision= 3;
|
||||
s2->intra_matrix[0]= 1;
|
||||
|
@@ -145,6 +145,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
{
|
||||
MpegEncContext *s = avctx->priv_data;
|
||||
|
||||
if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && avctx->height > 2800)
|
||||
avctx->thread_count = 1;
|
||||
|
||||
if(ff_MPV_encode_init(avctx) < 0)
|
||||
return -1;
|
||||
|
||||
@@ -180,6 +183,19 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
}
|
||||
}
|
||||
|
||||
if ((avctx->width & 0xFFF) == 0 && (avctx->height & 0xFFF) == 1) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Width / Height is invalid for MPEG2\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (s->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) {
|
||||
if ((avctx->width & 0xFFF) == 0 || (avctx->height & 0xFFF) == 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Width or Height are not allowed to be multiplies of 4096\n"
|
||||
"add '-strict %d' if you want to use them anyway.\n", FF_COMPLIANCE_UNOFFICIAL);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
}
|
||||
|
||||
s->drop_frame_timecode = s->drop_frame_timecode || !!(avctx->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE);
|
||||
if (s->drop_frame_timecode)
|
||||
s->tc.flags |= AV_TIMECODE_FLAG_DROPFRAME;
|
||||
@@ -227,8 +243,8 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
|
||||
/* mpeg1 header repeated every gop */
|
||||
put_header(s, SEQ_START_CODE);
|
||||
|
||||
put_sbits(&s->pb, 12, s->width );
|
||||
put_sbits(&s->pb, 12, s->height);
|
||||
put_sbits(&s->pb, 12, s->width & 0xFFF);
|
||||
put_sbits(&s->pb, 12, s->height & 0xFFF);
|
||||
|
||||
for(i=1; i<15; i++){
|
||||
float error= aspect_ratio;
|
||||
|
@@ -30,6 +30,7 @@ typedef struct MpegAudioParseContext {
|
||||
int frame_size;
|
||||
uint32_t header;
|
||||
int header_count;
|
||||
int no_bitrate;
|
||||
} MpegAudioParseContext;
|
||||
|
||||
#define MPA_HEADER_SIZE 4
|
||||
@@ -77,11 +78,14 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
|
||||
s->header_count++;
|
||||
s->frame_size = ret-4;
|
||||
|
||||
if (s->header_count > 1) {
|
||||
if (s->header_count > 0) {
|
||||
avctx->sample_rate= sr;
|
||||
avctx->channels = channels;
|
||||
s1->duration = frame_size;
|
||||
avctx->bit_rate = bit_rate;
|
||||
if (s->no_bitrate || !avctx->bit_rate) {
|
||||
s->no_bitrate = 1;
|
||||
avctx->bit_rate += (bit_rate - avctx->bit_rate) / s->header_count;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -1653,7 +1653,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
|
||||
buf += sx + sy * stride;
|
||||
ex -= sx;
|
||||
f = ((ey - sy) << 16) / ex;
|
||||
for(x= 0; x <= ex; x++){
|
||||
for (x = 0; x <= ex; x++) {
|
||||
y = (x * f) >> 16;
|
||||
fr = (x * f) & 0xFFFF;
|
||||
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16;
|
||||
@@ -2135,7 +2135,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
|
||||
ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
|
||||
ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
|
||||
|
||||
if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) ||
|
||||
if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) || uvsrc_y<0 ||
|
||||
(unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) {
|
||||
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y,
|
||||
linesize >> field_based, 17, 17 + field_based,
|
||||
@@ -2175,11 +2175,12 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
|
||||
pix_op[lowres - 1](dest_y, ptr_y, linesize, h, sx, sy);
|
||||
|
||||
if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
|
||||
int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h;
|
||||
uvsx = (uvsx << 2) >> lowres;
|
||||
uvsy = (uvsy << 2) >> lowres;
|
||||
if (h >> s->chroma_y_shift) {
|
||||
pix_op[op_index](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
|
||||
pix_op[op_index](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
|
||||
if (hc) {
|
||||
pix_op[op_index](dest_cb, ptr_cb, uvlinesize, hc, uvsx, uvsy);
|
||||
pix_op[op_index](dest_cr, ptr_cr, uvlinesize, hc, uvsx, uvsy);
|
||||
}
|
||||
}
|
||||
// FIXME h261 lowres loop filter
|
||||
|
@@ -731,7 +731,7 @@ typedef struct MpegEncContext {
|
||||
|
||||
#define REBASE_PICTURE(pic, new_ctx, old_ctx) (pic ? \
|
||||
(pic >= old_ctx->picture && pic < old_ctx->picture+old_ctx->picture_count ?\
|
||||
&new_ctx->picture[pic - old_ctx->picture] : pic - (Picture*)old_ctx + (Picture*)new_ctx)\
|
||||
&new_ctx->picture[pic - old_ctx->picture] : (Picture*) ((uint8_t*)pic - (uint8_t*)old_ctx + (uint8_t*)new_ctx))\
|
||||
: NULL)
|
||||
|
||||
/* mpegvideo_enc common options */
|
||||
|
@@ -138,14 +138,14 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
|
||||
unsigned int width= FFABS(pic->linesize[0]) / (depth >> 3);
|
||||
|
||||
output = pic->data[0] + (avctx->height - 1) * pic->linesize[0];
|
||||
output_end = pic->data[0] + avctx->height * pic->linesize[0];
|
||||
output_end = output + FFABS(pic->linesize[0]);
|
||||
|
||||
while (bytestream2_get_bytes_left(gb) > 0) {
|
||||
p1 = bytestream2_get_byteu(gb);
|
||||
if(p1 == 0) { //Escape code
|
||||
p2 = bytestream2_get_byte(gb);
|
||||
if(p2 == 0) { //End-of-line
|
||||
output = pic->data[0] + (--line) * pic->linesize[0];
|
||||
if (line < 0) {
|
||||
if (--line < 0) {
|
||||
if (bytestream2_get_be16(gb) == 1) { // end-of-picture
|
||||
return 0;
|
||||
} else {
|
||||
@@ -155,6 +155,8 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
output = pic->data[0] + line * pic->linesize[0];
|
||||
output_end = output + FFABS(pic->linesize[0]);
|
||||
pos = 0;
|
||||
continue;
|
||||
} else if(p2 == 1) { //End-of-picture
|
||||
@@ -169,11 +171,11 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
|
||||
return -1;
|
||||
}
|
||||
output = pic->data[0] + line * pic->linesize[0] + pos * (depth >> 3);
|
||||
output_end = pic->data[0] + line * pic->linesize[0] + FFABS(pic->linesize[0]);
|
||||
continue;
|
||||
}
|
||||
// Copy data
|
||||
if ((pic->linesize[0] > 0 && output + p2 * (depth >> 3) > output_end) ||
|
||||
(pic->linesize[0] < 0 && output + p2 * (depth >> 3) < output_end)) {
|
||||
if (output + p2 * (depth >> 3) > output_end) {
|
||||
bytestream2_skip(gb, 2 * (depth >> 3));
|
||||
continue;
|
||||
} else if (bytestream2_get_bytes_left(gb) < p2 * (depth >> 3)) {
|
||||
@@ -203,36 +205,39 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic,
|
||||
pos += p2;
|
||||
} else { //run of pixels
|
||||
uint8_t pix[3]; //original pixel
|
||||
switch(depth){
|
||||
case 8: pix[0] = bytestream2_get_byte(gb);
|
||||
break;
|
||||
case 16: pix16 = bytestream2_get_le16(gb);
|
||||
break;
|
||||
case 24: pix[0] = bytestream2_get_byte(gb);
|
||||
pix[1] = bytestream2_get_byte(gb);
|
||||
pix[2] = bytestream2_get_byte(gb);
|
||||
break;
|
||||
case 32: pix32 = bytestream2_get_le32(gb);
|
||||
break;
|
||||
}
|
||||
if ((pic->linesize[0] > 0 && output + p1 * (depth >> 3) > output_end) ||
|
||||
(pic->linesize[0] < 0 && output + p1 * (depth >> 3) < output_end))
|
||||
if (output + p1 * (depth >> 3) > output_end)
|
||||
continue;
|
||||
for(i = 0; i < p1; i++) {
|
||||
switch(depth){
|
||||
case 8: *output++ = pix[0];
|
||||
break;
|
||||
case 16: *(uint16_t*)output = pix16;
|
||||
output += 2;
|
||||
break;
|
||||
case 24: *output++ = pix[0];
|
||||
*output++ = pix[1];
|
||||
*output++ = pix[2];
|
||||
break;
|
||||
case 32: *(uint32_t*)output = pix32;
|
||||
output += 4;
|
||||
break;
|
||||
|
||||
switch(depth){
|
||||
case 8:
|
||||
pix[0] = bytestream2_get_byte(gb);
|
||||
for(i = 0; i < p1; i++)
|
||||
*output++ = pix[0];
|
||||
break;
|
||||
case 16:
|
||||
pix16 = bytestream2_get_le16(gb);
|
||||
for(i = 0; i < p1; i++) {
|
||||
*(uint16_t*)output = pix16;
|
||||
output += 2;
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
pix[0] = bytestream2_get_byte(gb);
|
||||
pix[1] = bytestream2_get_byte(gb);
|
||||
pix[2] = bytestream2_get_byte(gb);
|
||||
for(i = 0; i < p1; i++) {
|
||||
*output++ = pix[0];
|
||||
*output++ = pix[1];
|
||||
*output++ = pix[2];
|
||||
}
|
||||
break;
|
||||
case 32:
|
||||
pix32 = bytestream2_get_le32(gb);
|
||||
for(i = 0; i < p1; i++) {
|
||||
*(uint32_t*)output = pix32;
|
||||
output += 4;
|
||||
}
|
||||
break;
|
||||
}
|
||||
pos += p1;
|
||||
}
|
||||
|
@@ -397,7 +397,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
if (frame->nb_samples >= NELLY_BUF_LEN)
|
||||
s->last_frame = 1;
|
||||
}
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame) < 0))
|
||||
if ((ret = ff_af_queue_add(&s->afq, frame)) < 0)
|
||||
return ret;
|
||||
} else {
|
||||
memset(s->buf + NELLY_BUF_LEN, 0, NELLY_SAMPLES * sizeof(*s->buf));
|
||||
|
@@ -38,9 +38,7 @@ static const uint8_t ff_png_pass_xshift[NB_PASSES] = {
|
||||
|
||||
void *ff_png_zalloc(void *opaque, unsigned int items, unsigned int size)
|
||||
{
|
||||
if(items >= UINT_MAX / size)
|
||||
return NULL;
|
||||
return av_malloc(items * size);
|
||||
return av_mallocz_array(items, size);
|
||||
}
|
||||
|
||||
void ff_png_zfree(void *opaque, void *ptr)
|
||||
|
@@ -189,7 +189,7 @@ void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w
|
||||
if(bpp >= 2) g = dst[1];\
|
||||
if(bpp >= 3) b = dst[2];\
|
||||
if(bpp >= 4) a = dst[3];\
|
||||
for(; i < size; i+=bpp) {\
|
||||
for(; i <= size - bpp; i+=bpp) {\
|
||||
dst[i+0] = r = op(r, src[i+0], last[i+0]);\
|
||||
if(bpp == 1) continue;\
|
||||
dst[i+1] = g = op(g, src[i+1], last[i+1]);\
|
||||
@@ -205,13 +205,9 @@ void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w
|
||||
else if(bpp == 2) UNROLL1(2, op)\
|
||||
else if(bpp == 3) UNROLL1(3, op)\
|
||||
else if(bpp == 4) UNROLL1(4, op)\
|
||||
else {\
|
||||
for (; i < size; i += bpp) {\
|
||||
int j;\
|
||||
for (j = 0; j < bpp; j++)\
|
||||
dst[i+j] = op(dst[i+j-bpp], src[i+j], last[i+j]);\
|
||||
}\
|
||||
}
|
||||
for (; i < size; i++) {\
|
||||
dst[i] = op(dst[i-bpp], src[i], last[i]);\
|
||||
}\
|
||||
|
||||
/* NOTE: 'dst' can be equal to 'last' */
|
||||
static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
|
||||
|
@@ -244,12 +244,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
color_type = PNG_COLOR_TYPE_RGB;
|
||||
break;
|
||||
case AV_PIX_FMT_RGBA:
|
||||
avctx->bits_per_coded_sample = 32;
|
||||
bit_depth = 8;
|
||||
color_type = PNG_COLOR_TYPE_RGB_ALPHA;
|
||||
break;
|
||||
case AV_PIX_FMT_RGB24:
|
||||
avctx->bits_per_coded_sample = 24;
|
||||
bit_depth = 8;
|
||||
color_type = PNG_COLOR_TYPE_RGB;
|
||||
break;
|
||||
@@ -258,7 +256,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
color_type = PNG_COLOR_TYPE_GRAY;
|
||||
break;
|
||||
case AV_PIX_FMT_GRAY8:
|
||||
avctx->bits_per_coded_sample = 0x28;
|
||||
bit_depth = 8;
|
||||
color_type = PNG_COLOR_TYPE_GRAY;
|
||||
break;
|
||||
@@ -267,12 +264,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
|
||||
break;
|
||||
case AV_PIX_FMT_MONOBLACK:
|
||||
avctx->bits_per_coded_sample =
|
||||
bit_depth = 1;
|
||||
color_type = PNG_COLOR_TYPE_GRAY;
|
||||
break;
|
||||
case AV_PIX_FMT_PAL8:
|
||||
avctx->bits_per_coded_sample =
|
||||
bit_depth = 8;
|
||||
color_type = PNG_COLOR_TYPE_PALETTE;
|
||||
break;
|
||||
@@ -437,6 +432,23 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
static av_cold int png_enc_init(AVCodecContext *avctx){
|
||||
PNGEncContext *s = avctx->priv_data;
|
||||
|
||||
switch(avctx->pix_fmt) {
|
||||
case AV_PIX_FMT_RGBA:
|
||||
avctx->bits_per_coded_sample = 32;
|
||||
break;
|
||||
case AV_PIX_FMT_RGB24:
|
||||
avctx->bits_per_coded_sample = 24;
|
||||
break;
|
||||
case AV_PIX_FMT_GRAY8:
|
||||
avctx->bits_per_coded_sample = 0x28;
|
||||
break;
|
||||
case AV_PIX_FMT_MONOBLACK:
|
||||
avctx->bits_per_coded_sample = 1;
|
||||
break;
|
||||
case AV_PIX_FMT_PAL8:
|
||||
avctx->bits_per_coded_sample = 8;
|
||||
}
|
||||
|
||||
avcodec_get_frame_defaults(&s->picture);
|
||||
avctx->coded_frame= &s->picture;
|
||||
ff_dsputil_init(&s->dsp, avctx);
|
||||
|
@@ -106,7 +106,7 @@ av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *av
|
||||
if (!cutoff_coeff && avctx->codec_id == AV_CODEC_ID_AAC)
|
||||
cutoff_coeff = 2.0 * AAC_CUTOFF(avctx) / avctx->sample_rate;
|
||||
|
||||
if (cutoff_coeff)
|
||||
if (cutoff_coeff && cutoff_coeff < 0.98)
|
||||
ctx->fcoeffs = ff_iir_filter_init_coeffs(avctx, FF_FILTER_TYPE_BUTTERWORTH,
|
||||
FF_FILTER_MODE_LOWPASS, FILT_ORDER,
|
||||
cutoff_coeff, 0.0, 0.0);
|
||||
|
@@ -1258,7 +1258,7 @@ static void qdm2_decode_super_block (QDM2Context *q)
|
||||
for (i = 0; packet_bytes > 0; i++) {
|
||||
int j;
|
||||
|
||||
if (i>=FF_ARRAY_ELEMS(q->sub_packet_list_A)) {
|
||||
if (i >= FF_ARRAY_ELEMS(q->sub_packet_list_A)) {
|
||||
SAMPLES_NEEDED_2("too many packet bytes");
|
||||
return;
|
||||
}
|
||||
@@ -1870,6 +1870,10 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
|
||||
av_log(avctx, AV_LOG_ERROR, "Unknown FFT order (%d), contact the developers!\n", s->fft_order);
|
||||
return -1;
|
||||
}
|
||||
if (s->fft_size != (1 << (s->fft_order - 1))) {
|
||||
av_log(avctx, AV_LOG_ERROR, "FFT size %d not power of 2.\n", s->fft_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
ff_rdft_init(&s->rdft_ctx, s->fft_order, IDFT_C2R);
|
||||
ff_mpadsp_init(&s->mpadsp);
|
||||
|
@@ -56,22 +56,16 @@ typedef struct QtrleContext {
|
||||
static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
|
||||
{
|
||||
int rle_code;
|
||||
int pixel_ptr = 0;
|
||||
int pixel_ptr;
|
||||
int row_inc = s->frame.linesize[0];
|
||||
unsigned char pi0, pi1; /* 2 8-pixel values */
|
||||
unsigned char *rgb = s->frame.data[0];
|
||||
int pixel_limit = s->frame.linesize[0] * s->avctx->height;
|
||||
int skip;
|
||||
/* skip & 0x80 appears to mean 'start a new line', which can be interpreted
|
||||
* as 'go to next line' during the decoding of a frame but is 'go to first
|
||||
* line' at the beginning. Since we always interpret it as 'go to next line'
|
||||
* in the decoding loop (which makes code simpler/faster), the first line
|
||||
* would not be counted, so we count one more.
|
||||
* See: https://ffmpeg.org/trac/ffmpeg/ticket/226
|
||||
* In the following decoding loop, row_ptr will be the position of the
|
||||
* _next_ row. */
|
||||
lines_to_change++;
|
||||
|
||||
row_ptr -= row_inc;
|
||||
pixel_ptr = row_ptr;
|
||||
lines_to_change++;
|
||||
while (lines_to_change) {
|
||||
skip = bytestream2_get_byte(&s->g);
|
||||
rle_code = (signed char)bytestream2_get_byte(&s->g);
|
||||
@@ -79,8 +73,8 @@ static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
|
||||
break;
|
||||
if(skip & 0x80) {
|
||||
lines_to_change--;
|
||||
pixel_ptr = row_ptr + 2 * (skip & 0x7f);
|
||||
row_ptr += row_inc;
|
||||
pixel_ptr = row_ptr + 2 * (skip & 0x7f);
|
||||
} else
|
||||
pixel_ptr += 2 * skip;
|
||||
CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
|
||||
@@ -126,7 +120,7 @@ static inline void qtrle_decode_2n4bpp(QtrleContext *s, int row_ptr,
|
||||
|
||||
while (lines_to_change--) {
|
||||
pixel_ptr = row_ptr + (num_pixels * (bytestream2_get_byte(&s->g) - 1));
|
||||
CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
|
||||
CHECK_PIXEL_PTR(0);
|
||||
|
||||
while ((rle_code = (signed char)bytestream2_get_byte(&s->g)) != -1) {
|
||||
if (rle_code == 0) {
|
||||
@@ -181,7 +175,7 @@ static void qtrle_decode_8bpp(QtrleContext *s, int row_ptr, int lines_to_change)
|
||||
|
||||
while (lines_to_change--) {
|
||||
pixel_ptr = row_ptr + (4 * (bytestream2_get_byte(&s->g) - 1));
|
||||
CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
|
||||
CHECK_PIXEL_PTR(0);
|
||||
|
||||
while ((rle_code = (signed char)bytestream2_get_byte(&s->g)) != -1) {
|
||||
if (rle_code == 0) {
|
||||
@@ -231,7 +225,7 @@ static void qtrle_decode_16bpp(QtrleContext *s, int row_ptr, int lines_to_change
|
||||
|
||||
while (lines_to_change--) {
|
||||
pixel_ptr = row_ptr + (bytestream2_get_byte(&s->g) - 1) * 2;
|
||||
CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
|
||||
CHECK_PIXEL_PTR(0);
|
||||
|
||||
while ((rle_code = (signed char)bytestream2_get_byte(&s->g)) != -1) {
|
||||
if (rle_code == 0) {
|
||||
@@ -275,7 +269,7 @@ static void qtrle_decode_24bpp(QtrleContext *s, int row_ptr, int lines_to_change
|
||||
|
||||
while (lines_to_change--) {
|
||||
pixel_ptr = row_ptr + (bytestream2_get_byte(&s->g) - 1) * 3;
|
||||
CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
|
||||
CHECK_PIXEL_PTR(0);
|
||||
|
||||
while ((rle_code = (signed char)bytestream2_get_byte(&s->g)) != -1) {
|
||||
if (rle_code == 0) {
|
||||
@@ -322,7 +316,7 @@ static void qtrle_decode_32bpp(QtrleContext *s, int row_ptr, int lines_to_change
|
||||
|
||||
while (lines_to_change--) {
|
||||
pixel_ptr = row_ptr + (bytestream2_get_byte(&s->g) - 1) * 4;
|
||||
CHECK_PIXEL_PTR(0); /* make sure pixel_ptr is positive */
|
||||
CHECK_PIXEL_PTR(0);
|
||||
|
||||
while ((rle_code = (signed char)bytestream2_get_byte(&s->g)) != -1) {
|
||||
if (rle_code == 0) {
|
||||
|
@@ -536,7 +536,7 @@ static int ra144_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
for (; i < frame->nb_samples; i++)
|
||||
ractx->curr_block[i] = samples[i] >> 2;
|
||||
|
||||
if ((ret = ff_af_queue_add(&ractx->afq, frame) < 0))
|
||||
if ((ret = ff_af_queue_add(&ractx->afq, frame)) < 0)
|
||||
return ret;
|
||||
} else
|
||||
ractx->last_frame = 1;
|
||||
|
@@ -171,9 +171,10 @@ static av_cold int roq_decode_init(AVCodecContext *avctx)
|
||||
|
||||
s->avctx = avctx;
|
||||
|
||||
if (avctx->width%16 || avctx->height%16) {
|
||||
av_log_ask_for_sample(avctx, "dimensions not being a multiple of 16 are unsupported\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
if (avctx->width % 16 || avctx->height % 16) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Dimensions must be a multiple of 16\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
s->width = avctx->width;
|
||||
|
@@ -368,6 +368,11 @@ static int rv20_decode_picture_header(RVDecContext *rv)
|
||||
f = get_bits(&s->gb, rpr_bits);
|
||||
|
||||
if(f){
|
||||
if (s->avctx->extradata_size < 8 + 2 * f) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Extradata too small.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
new_w= 4*((uint8_t*)s->avctx->extradata)[6+2*f];
|
||||
new_h= 4*((uint8_t*)s->avctx->extradata)[7+2*f];
|
||||
}else{
|
||||
|
@@ -187,7 +187,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row)
|
||||
for(i = !mb_x; i < 2; i++, C += 4){
|
||||
int ij = i + (j >> 1);
|
||||
loc_lim = 0;
|
||||
if(cur_cbp && (1 << ij))
|
||||
if (cur_cbp & (1 << ij))
|
||||
loc_lim = cur_lim;
|
||||
else if(!i && left_cbp & (1 << (ij + 1)))
|
||||
loc_lim = left_lim;
|
||||
@@ -229,7 +229,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row)
|
||||
for(i = 0; i < 2; i++, C += 4){
|
||||
int ij = i + (j >> 1);
|
||||
loc_lim = 0;
|
||||
if(r->cbp_chroma[mb_pos] && (1 << ij))
|
||||
if (r->cbp_chroma[mb_pos] & (1 << ij))
|
||||
loc_lim = cur_lim;
|
||||
else if(!j && top_cbp & (1 << (ij + 2)))
|
||||
loc_lim = top_lim;
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "bytestream.h"
|
||||
#include "internal.h"
|
||||
#include "libavutil/bswap.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "sanm_data.h"
|
||||
|
||||
@@ -415,6 +416,11 @@ static int old_codec37(SANMVideoContext *ctx, int top,
|
||||
flags = bytestream2_get_byte(&ctx->gb);
|
||||
bytestream2_skip(&ctx->gb, 3);
|
||||
|
||||
if (decoded_size > ctx->height * stride - left - top * stride) {
|
||||
decoded_size = ctx->height * stride - left - top * stride;
|
||||
av_log(ctx->avctx, AV_LOG_WARNING, "decoded size is too large\n");
|
||||
}
|
||||
|
||||
ctx->rotate_code = 0;
|
||||
|
||||
if (((seq & 1) || !(flags & 1)) && (compr && compr != 2))
|
||||
@@ -638,6 +644,11 @@ static int old_codec47(SANMVideoContext *ctx, int top,
|
||||
decoded_size = bytestream2_get_le32(&ctx->gb);
|
||||
bytestream2_skip(&ctx->gb, 8);
|
||||
|
||||
if (decoded_size > ctx->height * stride - left - top * stride) {
|
||||
decoded_size = ctx->height * stride - left - top * stride;
|
||||
av_log(ctx->avctx, AV_LOG_WARNING, "decoded size is too large\n");
|
||||
}
|
||||
|
||||
if (skip & 1)
|
||||
bytestream2_skip(&ctx->gb, 0x8080);
|
||||
if (!seq) {
|
||||
@@ -715,9 +726,17 @@ static int process_frame_obj(SANMVideoContext *ctx)
|
||||
w = bytestream2_get_le16u(&ctx->gb);
|
||||
h = bytestream2_get_le16u(&ctx->gb);
|
||||
|
||||
if (!w || !h) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "dimensions are invalid\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (ctx->width < left + w || ctx->height < top + h) {
|
||||
ctx->avctx->width = FFMAX(left + w, ctx->width);
|
||||
ctx->avctx->height = FFMAX(top + h, ctx->height);
|
||||
if (av_image_check_size(FFMAX(left + w, ctx->width),
|
||||
FFMAX(top + h, ctx->height), 0, ctx->avctx) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
avcodec_set_dimensions(ctx->avctx, FFMAX(left + w, ctx->width),
|
||||
FFMAX(top + h, ctx->height));
|
||||
init_sizes(ctx, left + w, top + h);
|
||||
if (init_buffers(ctx)) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "error resizing buffers\n");
|
||||
|
@@ -88,7 +88,7 @@ typedef struct ShortenContext {
|
||||
GetBitContext gb;
|
||||
|
||||
int min_framesize, max_framesize;
|
||||
int channels;
|
||||
unsigned channels;
|
||||
|
||||
int32_t *decoded[MAX_CHANNELS];
|
||||
int32_t *decoded_base[MAX_CHANNELS];
|
||||
@@ -113,10 +113,10 @@ typedef struct ShortenContext {
|
||||
int got_quit_command;
|
||||
} ShortenContext;
|
||||
|
||||
static av_cold int shorten_decode_init(AVCodecContext * avctx)
|
||||
static av_cold int shorten_decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
ShortenContext *s = avctx->priv_data;
|
||||
s->avctx = avctx;
|
||||
s->avctx = avctx;
|
||||
|
||||
avcodec_get_frame_defaults(&s->frame);
|
||||
avctx->coded_frame = &s->frame;
|
||||
@@ -130,17 +130,20 @@ static int allocate_buffers(ShortenContext *s)
|
||||
int *coeffs;
|
||||
void *tmp_ptr;
|
||||
|
||||
for (chan=0; chan<s->channels; chan++) {
|
||||
if(FFMAX(1, s->nmean) >= UINT_MAX/sizeof(int32_t)){
|
||||
for (chan = 0; chan < s->channels; chan++) {
|
||||
if (FFMAX(1, s->nmean) >= UINT_MAX / sizeof(int32_t)) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "nmean too large\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if(s->blocksize + s->nwrap >= UINT_MAX/sizeof(int32_t) || s->blocksize + s->nwrap <= (unsigned)s->nwrap){
|
||||
av_log(s->avctx, AV_LOG_ERROR, "s->blocksize + s->nwrap too large\n");
|
||||
if (s->blocksize + s->nwrap >= UINT_MAX / sizeof(int32_t) ||
|
||||
s->blocksize + s->nwrap <= (unsigned)s->nwrap) {
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"s->blocksize + s->nwrap too large\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
tmp_ptr = av_realloc(s->offset[chan], sizeof(int32_t)*FFMAX(1, s->nmean));
|
||||
tmp_ptr =
|
||||
av_realloc(s->offset[chan], sizeof(int32_t) * FFMAX(1, s->nmean));
|
||||
if (!tmp_ptr)
|
||||
return AVERROR(ENOMEM);
|
||||
s->offset[chan] = tmp_ptr;
|
||||
@@ -150,7 +153,7 @@ static int allocate_buffers(ShortenContext *s)
|
||||
if (!tmp_ptr)
|
||||
return AVERROR(ENOMEM);
|
||||
s->decoded_base[chan] = tmp_ptr;
|
||||
for (i=0; i<s->nwrap; i++)
|
||||
for (i = 0; i < s->nwrap; i++)
|
||||
s->decoded_base[chan][i] = 0;
|
||||
s->decoded[chan] = s->decoded_base[chan] + s->nwrap;
|
||||
}
|
||||
@@ -163,7 +166,6 @@ static int allocate_buffers(ShortenContext *s)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static inline unsigned int get_uint(ShortenContext *s, int k)
|
||||
{
|
||||
if (s->version != 0)
|
||||
@@ -171,7 +173,6 @@ static inline unsigned int get_uint(ShortenContext *s, int k)
|
||||
return get_ur_golomb_shorten(&s->gb, k);
|
||||
}
|
||||
|
||||
|
||||
static void fix_bitshift(ShortenContext *s, int32_t *buffer)
|
||||
{
|
||||
int i;
|
||||
@@ -181,26 +182,24 @@ static void fix_bitshift(ShortenContext *s, int32_t *buffer)
|
||||
buffer[i] <<= s->bitshift;
|
||||
}
|
||||
|
||||
|
||||
static int init_offset(ShortenContext *s)
|
||||
{
|
||||
int32_t mean = 0;
|
||||
int chan, i;
|
||||
int chan, i;
|
||||
int nblock = FFMAX(1, s->nmean);
|
||||
/* initialise offset */
|
||||
switch (s->internal_ftype)
|
||||
{
|
||||
case TYPE_U8:
|
||||
s->avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
|
||||
mean = 0x80;
|
||||
break;
|
||||
case TYPE_S16HL:
|
||||
case TYPE_S16LH:
|
||||
s->avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
|
||||
break;
|
||||
default:
|
||||
av_log(s->avctx, AV_LOG_ERROR, "unknown audio type\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
switch (s->internal_ftype) {
|
||||
case TYPE_U8:
|
||||
s->avctx->sample_fmt = AV_SAMPLE_FMT_U8P;
|
||||
mean = 0x80;
|
||||
break;
|
||||
case TYPE_S16HL:
|
||||
case TYPE_S16LH:
|
||||
s->avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
|
||||
break;
|
||||
default:
|
||||
av_log(s->avctx, AV_LOG_ERROR, "unknown audio type\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
for (chan = 0; chan < s->channels; chan++)
|
||||
@@ -216,21 +215,21 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header,
|
||||
short wave_format;
|
||||
const uint8_t *end= header + header_size;
|
||||
|
||||
if (bytestream_get_le32(&header) != MKTAG('R','I','F','F')) {
|
||||
if (bytestream_get_le32(&header) != MKTAG('R', 'I', 'F', 'F')) {
|
||||
av_log(avctx, AV_LOG_ERROR, "missing RIFF tag\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
header += 4; /* chunk size */;
|
||||
header += 4; /* chunk size */
|
||||
|
||||
if (bytestream_get_le32(&header) != MKTAG('W','A','V','E')) {
|
||||
if (bytestream_get_le32(&header) != MKTAG('W', 'A', 'V', 'E')) {
|
||||
av_log(avctx, AV_LOG_ERROR, "missing WAVE tag\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
while (bytestream_get_le32(&header) != MKTAG('f','m','t',' ')) {
|
||||
len = bytestream_get_le32(&header);
|
||||
if(len<0 || end - header - 8 < len)
|
||||
while (bytestream_get_le32(&header) != MKTAG('f', 'm', 't', ' ')) {
|
||||
len = bytestream_get_le32(&header);
|
||||
if (len<0 || end - header - 8 < len)
|
||||
return AVERROR_INVALIDDATA;
|
||||
header += len;
|
||||
}
|
||||
@@ -244,11 +243,11 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header,
|
||||
wave_format = bytestream_get_le16(&header);
|
||||
|
||||
switch (wave_format) {
|
||||
case WAVE_FORMAT_PCM:
|
||||
break;
|
||||
default:
|
||||
av_log(avctx, AV_LOG_ERROR, "unsupported wave format\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
case WAVE_FORMAT_PCM:
|
||||
break;
|
||||
default:
|
||||
av_log(avctx, AV_LOG_ERROR, "unsupported wave format\n");
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
||||
header += 2; // skip channels (already got from shorten header)
|
||||
@@ -260,7 +259,7 @@ static int decode_wave_header(AVCodecContext *avctx, const uint8_t *header,
|
||||
|
||||
if (bps != 16 && bps != 8) {
|
||||
av_log(avctx, AV_LOG_ERROR, "unsupported number of bits per sample: %d\n", bps);
|
||||
return AVERROR_INVALIDDATA;
|
||||
return AVERROR(ENOSYS);
|
||||
}
|
||||
|
||||
len -= 16;
|
||||
@@ -286,11 +285,12 @@ static int decode_subframe_lpc(ShortenContext *s, int command, int channel,
|
||||
/* read/validate prediction order */
|
||||
pred_order = get_ur_golomb_shorten(&s->gb, LPCQSIZE);
|
||||
if (pred_order > s->nwrap) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n", pred_order);
|
||||
av_log(s->avctx, AV_LOG_ERROR, "invalid pred_order %d\n",
|
||||
pred_order);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
/* read LPC coefficients */
|
||||
for (i=0; i<pred_order; i++)
|
||||
for (i = 0; i < pred_order; i++)
|
||||
s->coeffs[i] = get_sr_golomb_shorten(&s->gb, LPCQUANT);
|
||||
coeffs = s->coeffs;
|
||||
|
||||
@@ -298,7 +298,7 @@ static int decode_subframe_lpc(ShortenContext *s, int command, int channel,
|
||||
} else {
|
||||
/* fixed LPC coeffs */
|
||||
pred_order = command;
|
||||
coeffs = fixed_coeffs[pred_order-1];
|
||||
coeffs = fixed_coeffs[pred_order - 1];
|
||||
qshift = 0;
|
||||
}
|
||||
|
||||
@@ -309,11 +309,12 @@ static int decode_subframe_lpc(ShortenContext *s, int command, int channel,
|
||||
|
||||
/* decode residual and do LPC prediction */
|
||||
init_sum = pred_order ? (command == FN_QLPC ? s->lpcqoffset : 0) : coffset;
|
||||
for (i=0; i < s->blocksize; i++) {
|
||||
for (i = 0; i < s->blocksize; i++) {
|
||||
sum = init_sum;
|
||||
for (j=0; j<pred_order; j++)
|
||||
sum += coeffs[j] * s->decoded[channel][i-j-1];
|
||||
s->decoded[channel][i] = get_sr_golomb_shorten(&s->gb, residual_size) + (sum >> qshift);
|
||||
for (j = 0; j < pred_order; j++)
|
||||
sum += coeffs[j] * s->decoded[channel][i - j - 1];
|
||||
s->decoded[channel][i] = get_sr_golomb_shorten(&s->gb, residual_size) +
|
||||
(sum >> qshift);
|
||||
}
|
||||
|
||||
/* add offset to current samples */
|
||||
@@ -334,38 +335,44 @@ static int read_header(ShortenContext *s)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
s->lpcqoffset = 0;
|
||||
s->blocksize = DEFAULT_BLOCK_SIZE;
|
||||
s->nmean = -1;
|
||||
s->version = get_bits(&s->gb, 8);
|
||||
s->lpcqoffset = 0;
|
||||
s->blocksize = DEFAULT_BLOCK_SIZE;
|
||||
s->nmean = -1;
|
||||
s->version = get_bits(&s->gb, 8);
|
||||
s->internal_ftype = get_uint(s, TYPESIZE);
|
||||
|
||||
s->channels = get_uint(s, CHANSIZE);
|
||||
if (s->channels <= 0 || s->channels > MAX_CHANNELS) {
|
||||
if (!s->channels) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "No channels reported\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (s->channels > MAX_CHANNELS) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
|
||||
s->channels = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
s->avctx->channels = s->channels;
|
||||
|
||||
/* get blocksize if version > 0 */
|
||||
if (s->version > 0) {
|
||||
int skip_bytes, blocksize;
|
||||
int skip_bytes;
|
||||
unsigned blocksize;
|
||||
|
||||
blocksize = get_uint(s, av_log2(DEFAULT_BLOCK_SIZE));
|
||||
if (!blocksize || blocksize > MAX_BLOCKSIZE) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "invalid or unsupported block size: %d\n",
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"invalid or unsupported block size: %d\n",
|
||||
blocksize);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
s->blocksize = blocksize;
|
||||
|
||||
maxnlpc = get_uint(s, LPCQSIZE);
|
||||
maxnlpc = get_uint(s, LPCQSIZE);
|
||||
s->nmean = get_uint(s, 0);
|
||||
|
||||
skip_bytes = get_uint(s, NSKIPSIZE);
|
||||
for (i=0; i<skip_bytes; i++) {
|
||||
for (i = 0; i < skip_bytes; i++)
|
||||
skip_bits(&s->gb, 8);
|
||||
}
|
||||
}
|
||||
s->nwrap = FFMAX(NWRAP, maxnlpc);
|
||||
|
||||
@@ -379,17 +386,20 @@ static int read_header(ShortenContext *s)
|
||||
s->lpcqoffset = V2LPCQOFFSET;
|
||||
|
||||
if (get_ur_golomb_shorten(&s->gb, FNSIZE) != FN_VERBATIM) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "missing verbatim section at beginning of stream\n");
|
||||
av_log(s->avctx, AV_LOG_ERROR,
|
||||
"missing verbatim section at beginning of stream\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
s->header_size = get_ur_golomb_shorten(&s->gb, VERBATIM_CKSIZE_SIZE);
|
||||
if (s->header_size >= OUT_BUFFER_SIZE || s->header_size < CANONICAL_HEADER_SIZE) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "header is wrong size: %d\n", s->header_size);
|
||||
if (s->header_size >= OUT_BUFFER_SIZE ||
|
||||
s->header_size < CANONICAL_HEADER_SIZE) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "header is wrong size: %d\n",
|
||||
s->header_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (i=0; i<s->header_size; i++)
|
||||
for (i = 0; i < s->header_size; i++)
|
||||
s->header[i] = (char)get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
|
||||
|
||||
if ((ret = decode_wave_header(s->avctx, s->header, s->header_size)) < 0)
|
||||
@@ -407,15 +417,15 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
||||
int *got_frame_ptr, AVPacket *avpkt)
|
||||
{
|
||||
const uint8_t *buf = avpkt->data;
|
||||
int buf_size = avpkt->size;
|
||||
ShortenContext *s = avctx->priv_data;
|
||||
int buf_size = avpkt->size;
|
||||
ShortenContext *s = avctx->priv_data;
|
||||
int i, input_buf_size = 0;
|
||||
int ret;
|
||||
|
||||
/* allocate internal bitstream buffer */
|
||||
if(s->max_framesize == 0){
|
||||
if (s->max_framesize == 0) {
|
||||
void *tmp_ptr;
|
||||
s->max_framesize= 8192; // should hopefully be enough for the first header
|
||||
s->max_framesize = 8192; // should hopefully be enough for the first header
|
||||
tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
|
||||
s->max_framesize);
|
||||
if (!tmp_ptr) {
|
||||
@@ -426,29 +436,32 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
/* append current packet data to bitstream buffer */
|
||||
if(1 && s->max_framesize){//FIXME truncated
|
||||
buf_size= FFMIN(buf_size, s->max_framesize - s->bitstream_size);
|
||||
input_buf_size= buf_size;
|
||||
if (1 && s->max_framesize) { //FIXME truncated
|
||||
buf_size = FFMIN(buf_size, s->max_framesize - s->bitstream_size);
|
||||
input_buf_size = buf_size;
|
||||
|
||||
if(s->bitstream_index + s->bitstream_size + buf_size > s->allocated_bitstream_size){
|
||||
memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);
|
||||
s->bitstream_index=0;
|
||||
if (s->bitstream_index + s->bitstream_size + buf_size >
|
||||
s->allocated_bitstream_size) {
|
||||
memmove(s->bitstream, &s->bitstream[s->bitstream_index],
|
||||
s->bitstream_size);
|
||||
s->bitstream_index = 0;
|
||||
}
|
||||
if (buf)
|
||||
memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], buf, buf_size);
|
||||
buf= &s->bitstream[s->bitstream_index];
|
||||
buf_size += s->bitstream_size;
|
||||
s->bitstream_size= buf_size;
|
||||
memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], buf,
|
||||
buf_size);
|
||||
buf = &s->bitstream[s->bitstream_index];
|
||||
buf_size += s->bitstream_size;
|
||||
s->bitstream_size = buf_size;
|
||||
|
||||
/* do not decode until buffer has at least max_framesize bytes or
|
||||
the end of the file has been reached */
|
||||
* the end of the file has been reached */
|
||||
if (buf_size < s->max_framesize && avpkt->data) {
|
||||
*got_frame_ptr = 0;
|
||||
return input_buf_size;
|
||||
}
|
||||
}
|
||||
/* init and position bitstream reader */
|
||||
init_get_bits(&s->gb, buf, buf_size*8);
|
||||
init_get_bits(&s->gb, buf, buf_size * 8);
|
||||
skip_bits(&s->gb, s->bitindex);
|
||||
|
||||
/* process header or next subblock */
|
||||
@@ -470,7 +483,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
||||
unsigned int cmd;
|
||||
int len;
|
||||
|
||||
if (get_bits_left(&s->gb) < 3+FNSIZE) {
|
||||
if (get_bits_left(&s->gb) < 3 + FNSIZE) {
|
||||
*got_frame_ptr = 0;
|
||||
break;
|
||||
}
|
||||
@@ -486,32 +499,32 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if (!is_audio_command[cmd]) {
|
||||
/* process non-audio command */
|
||||
switch (cmd) {
|
||||
case FN_VERBATIM:
|
||||
len = get_ur_golomb_shorten(&s->gb, VERBATIM_CKSIZE_SIZE);
|
||||
while (len--) {
|
||||
get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
|
||||
}
|
||||
break;
|
||||
case FN_BITSHIFT:
|
||||
s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
|
||||
break;
|
||||
case FN_BLOCKSIZE: {
|
||||
int blocksize = get_uint(s, av_log2(s->blocksize));
|
||||
if (blocksize > s->blocksize) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Increasing block size is not supported\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
if (!blocksize || blocksize > MAX_BLOCKSIZE) {
|
||||
av_log(avctx, AV_LOG_ERROR, "invalid or unsupported "
|
||||
"block size: %d\n", blocksize);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
s->blocksize = blocksize;
|
||||
break;
|
||||
case FN_VERBATIM:
|
||||
len = get_ur_golomb_shorten(&s->gb, VERBATIM_CKSIZE_SIZE);
|
||||
while (len--)
|
||||
get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
|
||||
break;
|
||||
case FN_BITSHIFT:
|
||||
s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
|
||||
break;
|
||||
case FN_BLOCKSIZE: {
|
||||
unsigned blocksize = get_uint(s, av_log2(s->blocksize));
|
||||
if (blocksize > s->blocksize) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Increasing block size is not supported\n");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
case FN_QUIT:
|
||||
s->got_quit_command = 1;
|
||||
break;
|
||||
if (!blocksize || blocksize > MAX_BLOCKSIZE) {
|
||||
av_log(avctx, AV_LOG_ERROR, "invalid or unsupported "
|
||||
"block size: %d\n", blocksize);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
s->blocksize = blocksize;
|
||||
break;
|
||||
}
|
||||
case FN_QUIT:
|
||||
s->got_quit_command = 1;
|
||||
break;
|
||||
}
|
||||
if (cmd == FN_BLOCKSIZE || cmd == FN_QUIT) {
|
||||
*got_frame_ptr = 0;
|
||||
@@ -537,7 +550,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
||||
coffset = s->offset[channel][0];
|
||||
else {
|
||||
int32_t sum = (s->version < 2) ? 0 : s->nmean / 2;
|
||||
for (i=0; i<s->nmean; i++)
|
||||
for (i = 0; i < s->nmean; i++)
|
||||
sum += s->offset[channel][i];
|
||||
coffset = sum / s->nmean;
|
||||
if (s->version >= 2)
|
||||
@@ -546,21 +559,22 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
/* decode samples for this channel */
|
||||
if (cmd == FN_ZERO) {
|
||||
for (i=0; i<s->blocksize; i++)
|
||||
for (i = 0; i < s->blocksize; i++)
|
||||
s->decoded[channel][i] = 0;
|
||||
} else {
|
||||
if ((ret = decode_subframe_lpc(s, cmd, channel, residual_size, coffset)) < 0)
|
||||
if ((ret = decode_subframe_lpc(s, cmd, channel,
|
||||
residual_size, coffset)) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* update means with info from the current block */
|
||||
if (s->nmean > 0) {
|
||||
int32_t sum = (s->version < 2) ? 0 : s->blocksize / 2;
|
||||
for (i=0; i<s->blocksize; i++)
|
||||
for (i = 0; i < s->blocksize; i++)
|
||||
sum += s->decoded[channel][i];
|
||||
|
||||
for (i=1; i<s->nmean; i++)
|
||||
s->offset[channel][i-1] = s->offset[channel][i];
|
||||
for (i = 1; i < s->nmean; i++)
|
||||
s->offset[channel][i - 1] = s->offset[channel][i];
|
||||
|
||||
if (s->version < 2)
|
||||
s->offset[channel][s->nmean - 1] = sum / s->blocksize;
|
||||
@@ -569,11 +583,11 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
|
||||
/* copy wrap samples for use with next block */
|
||||
for (i=-s->nwrap; i<0; i++)
|
||||
for (i = -s->nwrap; i < 0; i++)
|
||||
s->decoded[channel][i] = s->decoded[channel][i + s->blocksize];
|
||||
|
||||
/* shift samples to add in unused zero bits which were removed
|
||||
during encoding */
|
||||
* during encoding */
|
||||
fix_bitshift(s, s->decoded[channel]);
|
||||
|
||||
/* if this is the last channel in the block, output the samples */
|
||||
@@ -616,12 +630,12 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
|
||||
*got_frame_ptr = 0;
|
||||
|
||||
finish_frame:
|
||||
s->bitindex = get_bits_count(&s->gb) - 8*((get_bits_count(&s->gb))/8);
|
||||
i= (get_bits_count(&s->gb))/8;
|
||||
s->bitindex = get_bits_count(&s->gb) - 8 * (get_bits_count(&s->gb) / 8);
|
||||
i = get_bits_count(&s->gb) / 8;
|
||||
if (i > buf_size) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "overread: %d\n", i - buf_size);
|
||||
s->bitstream_size=0;
|
||||
s->bitstream_index=0;
|
||||
s->bitstream_size = 0;
|
||||
s->bitstream_index = 0;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (s->bitstream_size) {
|
||||
|
@@ -321,7 +321,8 @@ static void svq1_skip_block(uint8_t *current, uint8_t *previous,
|
||||
|
||||
static int svq1_motion_inter_block(DSPContext *dsp, GetBitContext *bitbuf,
|
||||
uint8_t *current, uint8_t *previous,
|
||||
int pitch, svq1_pmv *motion, int x, int y)
|
||||
int pitch, svq1_pmv *motion, int x, int y,
|
||||
int width, int height)
|
||||
{
|
||||
uint8_t *src;
|
||||
uint8_t *dst;
|
||||
@@ -350,10 +351,8 @@ static int svq1_motion_inter_block(DSPContext *dsp, GetBitContext *bitbuf,
|
||||
motion[x / 8 + 2].y =
|
||||
motion[x / 8 + 3].y = mv.y;
|
||||
|
||||
if (y + (mv.y >> 1) < 0)
|
||||
mv.y = 0;
|
||||
if (x + (mv.x >> 1) < 0)
|
||||
mv.x = 0;
|
||||
mv.x = av_clip(mv.x, -2 * x, 2 * (width - x - 16));
|
||||
mv.y = av_clip(mv.y, -2 * y, 2 * (height - y - 16));
|
||||
|
||||
src = &previous[(x + (mv.x >> 1)) + (y + (mv.y >> 1)) * pitch];
|
||||
dst = current;
|
||||
@@ -365,7 +364,8 @@ static int svq1_motion_inter_block(DSPContext *dsp, GetBitContext *bitbuf,
|
||||
|
||||
static int svq1_motion_inter_4v_block(DSPContext *dsp, GetBitContext *bitbuf,
|
||||
uint8_t *current, uint8_t *previous,
|
||||
int pitch, svq1_pmv *motion, int x, int y)
|
||||
int pitch, svq1_pmv *motion, int x, int y,
|
||||
int width, int height)
|
||||
{
|
||||
uint8_t *src;
|
||||
uint8_t *dst;
|
||||
@@ -421,10 +421,8 @@ static int svq1_motion_inter_4v_block(DSPContext *dsp, GetBitContext *bitbuf,
|
||||
int mvy = pmv[i]->y + (i >> 1) * 16;
|
||||
|
||||
// FIXME: clipping or padding?
|
||||
if (y + (mvy >> 1) < 0)
|
||||
mvy = 0;
|
||||
if (x + (mvx >> 1) < 0)
|
||||
mvx = 0;
|
||||
mvx = av_clip(mvx, -2 * x, 2 * (width - x - 8));
|
||||
mvy = av_clip(mvy, -2 * y, 2 * (height - y - 8));
|
||||
|
||||
src = &previous[(x + (mvx >> 1)) + (y + (mvy >> 1)) * pitch];
|
||||
dst = current;
|
||||
@@ -444,7 +442,8 @@ static int svq1_motion_inter_4v_block(DSPContext *dsp, GetBitContext *bitbuf,
|
||||
static int svq1_decode_delta_block(AVCodecContext *avctx, DSPContext *dsp,
|
||||
GetBitContext *bitbuf,
|
||||
uint8_t *current, uint8_t *previous,
|
||||
int pitch, svq1_pmv *motion, int x, int y)
|
||||
int pitch, svq1_pmv *motion, int x, int y,
|
||||
int width, int height)
|
||||
{
|
||||
uint32_t block_type;
|
||||
int result = 0;
|
||||
@@ -469,7 +468,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, DSPContext *dsp,
|
||||
|
||||
case SVQ1_BLOCK_INTER:
|
||||
result = svq1_motion_inter_block(dsp, bitbuf, current, previous,
|
||||
pitch, motion, x, y);
|
||||
pitch, motion, x, y, width, height);
|
||||
|
||||
if (result != 0) {
|
||||
av_dlog(avctx, "Error in svq1_motion_inter_block %i\n", result);
|
||||
@@ -480,7 +479,7 @@ static int svq1_decode_delta_block(AVCodecContext *avctx, DSPContext *dsp,
|
||||
|
||||
case SVQ1_BLOCK_INTER_4V:
|
||||
result = svq1_motion_inter_4v_block(dsp, bitbuf, current, previous,
|
||||
pitch, motion, x, y);
|
||||
pitch, motion, x, y, width, height);
|
||||
|
||||
if (result != 0) {
|
||||
av_dlog(avctx, "Error in svq1_motion_inter_4v_block %i\n", result);
|
||||
@@ -692,7 +691,8 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data,
|
||||
} else {
|
||||
/* delta frame */
|
||||
uint8_t *previous = s->prev->data[i];
|
||||
if (!previous) {
|
||||
if (!previous ||
|
||||
s->prev->width != s->width || s->prev->height != s->height) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
|
||||
result = AVERROR_INVALIDDATA;
|
||||
goto err;
|
||||
@@ -705,8 +705,8 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data,
|
||||
result = svq1_decode_delta_block(avctx, &s->dsp,
|
||||
&s->gb, ¤t[x],
|
||||
previous, linesize,
|
||||
pmv, x, y);
|
||||
if (result) {
|
||||
pmv, x, y, width, height);
|
||||
if (result != 0) {
|
||||
av_dlog(avctx,
|
||||
"Error in svq1_decode_delta_block %i\n",
|
||||
result);
|
||||
|
@@ -538,7 +538,7 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
int i, ret;
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, s->y_block_width * s->y_block_height *
|
||||
MAX_MB_BYTES*3 + FF_MIN_BUFFER_SIZE) < 0))
|
||||
MAX_MB_BYTES*3 + FF_MIN_BUFFER_SIZE)) < 0)
|
||||
return ret;
|
||||
|
||||
if (avctx->pix_fmt != AV_PIX_FMT_YUV410P) {
|
||||
@@ -547,7 +547,7 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
}
|
||||
|
||||
if (!s->current_picture.data[0]) {
|
||||
if ((ret = ff_get_buffer(avctx, &s->current_picture) < 0) ||
|
||||
if ((ret = ff_get_buffer(avctx, &s->current_picture))< 0 ||
|
||||
(ret = ff_get_buffer(avctx, &s->last_picture)) < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ static uint8_t *advance_line(uint8_t *start, uint8_t *line,
|
||||
return line + interleave * stride;
|
||||
} else {
|
||||
*y = (*y + 1) & (interleave - 1);
|
||||
if (*y) {
|
||||
if (*y && *y < h) {
|
||||
return start + *y * stride;
|
||||
} else {
|
||||
return NULL;
|
||||
|
@@ -212,10 +212,12 @@ static char *doubles2str(double *dp, int count, const char *sep)
|
||||
{
|
||||
int i;
|
||||
char *ap, *ap0;
|
||||
int component_len;
|
||||
uint64_t component_len;
|
||||
if (!sep) sep = ", ";
|
||||
component_len = 15 + strlen(sep);
|
||||
ap = av_malloc(component_len * count);
|
||||
component_len = 15LL + strlen(sep);
|
||||
if (count >= (INT_MAX - 1)/component_len)
|
||||
return NULL;
|
||||
ap = av_malloc(component_len * count + 1);
|
||||
if (!ap)
|
||||
return NULL;
|
||||
ap0 = ap;
|
||||
@@ -236,14 +238,22 @@ static char *shorts2str(int16_t *sp, int count, const char *sep)
|
||||
{
|
||||
int i;
|
||||
char *ap, *ap0;
|
||||
uint64_t component_len;
|
||||
if (!sep) sep = ", ";
|
||||
ap = av_malloc((5 + strlen(sep)) * count);
|
||||
component_len = 7LL + strlen(sep);
|
||||
if (count >= (INT_MAX - 1)/component_len)
|
||||
return NULL;
|
||||
ap = av_malloc(component_len * count + 1);
|
||||
if (!ap)
|
||||
return NULL;
|
||||
ap0 = ap;
|
||||
ap[0] = '\0';
|
||||
for (i = 0; i < count; i++) {
|
||||
int l = snprintf(ap, 5 + strlen(sep), "%d%s", sp[i], sep);
|
||||
unsigned l = snprintf(ap, component_len, "%d%s", sp[i], sep);
|
||||
if (l >= component_len) {
|
||||
av_free(ap0);
|
||||
return NULL;
|
||||
}
|
||||
ap += l;
|
||||
}
|
||||
ap0[strlen(ap0) - strlen(sep)] = '\0';
|
||||
@@ -878,7 +888,7 @@ static int tiff_decode_tag(TiffContext *s)
|
||||
s->fax_opts = value;
|
||||
break;
|
||||
#define ADD_METADATA(count, name, sep)\
|
||||
if (ret = add_metadata(count, type, name, sep, s) < 0) {\
|
||||
if ((ret = add_metadata(count, type, name, sep, s)) < 0) {\
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");\
|
||||
return ret;\
|
||||
}
|
||||
|
@@ -1018,6 +1018,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
|
||||
&& avctx->bit_rate>0 && avctx->bit_rate<1000) {
|
||||
av_log(avctx, AV_LOG_WARNING, "Bitrate %d is extreemly low, did you mean %dk\n", avctx->bit_rate, avctx->bit_rate);
|
||||
}
|
||||
|
||||
if (!avctx->rc_initial_buffer_occupancy)
|
||||
avctx->rc_initial_buffer_occupancy = avctx->rc_buffer_size * 3 / 4;
|
||||
}
|
||||
|
||||
avctx->pts_correction_num_faulty_pts =
|
||||
@@ -1764,7 +1767,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
|
||||
av_log(avctx, AV_LOG_DEBUG, "skip %d samples due to side data\n",
|
||||
avctx->internal->skip_samples);
|
||||
}
|
||||
if (avctx->internal->skip_samples) {
|
||||
if (avctx->internal->skip_samples && *got_frame_ptr) {
|
||||
if(frame->nb_samples <= avctx->internal->skip_samples){
|
||||
*got_frame_ptr = 0;
|
||||
avctx->internal->skip_samples -= frame->nb_samples;
|
||||
@@ -1806,7 +1809,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
|
||||
* extended_data are doing it correctly */
|
||||
if (*got_frame_ptr) {
|
||||
planar = av_sample_fmt_is_planar(frame->format);
|
||||
channels = av_get_channel_layout_nb_channels(frame->channel_layout);
|
||||
channels = frame->channels;
|
||||
if (!(planar && channels > AV_NUM_DATA_POINTERS))
|
||||
frame->extended_data = frame->data;
|
||||
} else {
|
||||
|
@@ -1149,8 +1149,12 @@ static av_always_inline void get_mvdata_interlaced(VC1Context *v, int *dmv_x,
|
||||
*dmv_x = get_bits(gb, v->k_x);
|
||||
*dmv_y = get_bits(gb, v->k_y);
|
||||
if (v->numref) {
|
||||
*pred_flag = *dmv_y & 1;
|
||||
*dmv_y = (*dmv_y + *pred_flag) >> 1;
|
||||
if (pred_flag) {
|
||||
*pred_flag = *dmv_y & 1;
|
||||
*dmv_y = (*dmv_y + *pred_flag) >> 1;
|
||||
} else {
|
||||
*dmv_y = (*dmv_y + (*dmv_y & 1)) >> 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1177,7 +1181,7 @@ static av_always_inline void get_mvdata_interlaced(VC1Context *v, int *dmv_x,
|
||||
*dmv_y = (sign ^ ((val >> 1) + offs_tab[index1 >> v->numref])) - sign;
|
||||
} else
|
||||
*dmv_y = 0;
|
||||
if (v->numref)
|
||||
if (v->numref && pred_flag)
|
||||
*pred_flag = index1 & 1;
|
||||
}
|
||||
}
|
||||
|
@@ -162,7 +162,7 @@ static int rle_unpack(const unsigned char *src, int src_len, int src_count,
|
||||
const unsigned char *ps;
|
||||
const unsigned char *ps_end;
|
||||
unsigned char *pd;
|
||||
int i, l;
|
||||
int i, j, l;
|
||||
unsigned char *dest_end = dest + dest_len;
|
||||
|
||||
ps = src;
|
||||
@@ -188,9 +188,9 @@ static int rle_unpack(const unsigned char *src, int src_len, int src_count,
|
||||
ps += l;
|
||||
pd += l;
|
||||
} else {
|
||||
if (dest_end - pd < i || ps_end - ps < 2)
|
||||
if (dest_end - pd < 2*l || ps_end - ps < 2)
|
||||
return ps - src;
|
||||
for (i = 0; i < l; i++) {
|
||||
for (j = 0; j < l; j++) {
|
||||
*pd++ = ps[0];
|
||||
*pd++ = ps[1];
|
||||
}
|
||||
@@ -624,7 +624,7 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data,
|
||||
/* decode audio chunks */
|
||||
if (audio_chunks > 0) {
|
||||
buf_end = buf + buf_size;
|
||||
while ( buf_end - buf >= s->chunk_size) {
|
||||
while (buf_end - buf >= s->chunk_size) {
|
||||
if (s->out_bps == 2) {
|
||||
decode_audio_s16(output_samples_s16, buf, s->chunk_size,
|
||||
avctx->channels);
|
||||
|
@@ -195,37 +195,41 @@ static void vorbis_free(vorbis_context *vc)
|
||||
av_freep(&vc->channel_residues);
|
||||
av_freep(&vc->saved);
|
||||
|
||||
for (i = 0; i < vc->residue_count; i++)
|
||||
av_free(vc->residues[i].classifs);
|
||||
if (vc->residues)
|
||||
for (i = 0; i < vc->residue_count; i++)
|
||||
av_free(vc->residues[i].classifs);
|
||||
av_freep(&vc->residues);
|
||||
av_freep(&vc->modes);
|
||||
|
||||
ff_mdct_end(&vc->mdct[0]);
|
||||
ff_mdct_end(&vc->mdct[1]);
|
||||
|
||||
for (i = 0; i < vc->codebook_count; ++i) {
|
||||
av_free(vc->codebooks[i].codevectors);
|
||||
ff_free_vlc(&vc->codebooks[i].vlc);
|
||||
}
|
||||
if (vc->codebooks)
|
||||
for (i = 0; i < vc->codebook_count; ++i) {
|
||||
av_free(vc->codebooks[i].codevectors);
|
||||
ff_free_vlc(&vc->codebooks[i].vlc);
|
||||
}
|
||||
av_freep(&vc->codebooks);
|
||||
|
||||
for (i = 0; i < vc->floor_count; ++i) {
|
||||
if (vc->floors[i].floor_type == 0) {
|
||||
av_free(vc->floors[i].data.t0.map[0]);
|
||||
av_free(vc->floors[i].data.t0.map[1]);
|
||||
av_free(vc->floors[i].data.t0.book_list);
|
||||
av_free(vc->floors[i].data.t0.lsp);
|
||||
} else {
|
||||
av_free(vc->floors[i].data.t1.list);
|
||||
if (vc->floors)
|
||||
for (i = 0; i < vc->floor_count; ++i) {
|
||||
if (vc->floors[i].floor_type == 0) {
|
||||
av_free(vc->floors[i].data.t0.map[0]);
|
||||
av_free(vc->floors[i].data.t0.map[1]);
|
||||
av_free(vc->floors[i].data.t0.book_list);
|
||||
av_free(vc->floors[i].data.t0.lsp);
|
||||
} else {
|
||||
av_free(vc->floors[i].data.t1.list);
|
||||
}
|
||||
}
|
||||
}
|
||||
av_freep(&vc->floors);
|
||||
|
||||
for (i = 0; i < vc->mapping_count; ++i) {
|
||||
av_free(vc->mappings[i].magnitude);
|
||||
av_free(vc->mappings[i].angle);
|
||||
av_free(vc->mappings[i].mux);
|
||||
}
|
||||
if (vc->mappings)
|
||||
for (i = 0; i < vc->mapping_count; ++i) {
|
||||
av_free(vc->mappings[i].magnitude);
|
||||
av_free(vc->mappings[i].angle);
|
||||
av_free(vc->mappings[i].mux);
|
||||
}
|
||||
av_freep(&vc->mappings);
|
||||
}
|
||||
|
||||
@@ -587,16 +591,24 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
|
||||
floor_setup->decode = vorbis_floor0_decode;
|
||||
|
||||
floor_setup->data.t0.order = get_bits(gb, 8);
|
||||
floor_setup->data.t0.rate = get_bits(gb, 16);
|
||||
floor_setup->data.t0.bark_map_size = get_bits(gb, 16);
|
||||
floor_setup->data.t0.amplitude_bits = get_bits(gb, 6);
|
||||
/* zero would result in a div by zero later *
|
||||
* 2^0 - 1 == 0 */
|
||||
if (floor_setup->data.t0.amplitude_bits == 0) {
|
||||
if (!floor_setup->data.t0.order) {
|
||||
av_log(vc->avccontext, AV_LOG_ERROR,
|
||||
"Floor 0 amplitude bits is 0.\n");
|
||||
"Floor 0 order is 0.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
floor_setup->data.t0.rate = get_bits(gb, 16);
|
||||
if (!floor_setup->data.t0.rate) {
|
||||
av_log(vc->avccontext, AV_LOG_ERROR,
|
||||
"Floor 0 rate is 0.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
floor_setup->data.t0.bark_map_size = get_bits(gb, 16);
|
||||
if (floor_setup->data.t0.bark_map_size == 0) {
|
||||
av_log(vc->avccontext, AV_LOG_ERROR,
|
||||
"Floor 0 bark map size is 0.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
floor_setup->data.t0.amplitude_bits = get_bits(gb, 6);
|
||||
floor_setup->data.t0.amplitude_offset = get_bits(gb, 8);
|
||||
floor_setup->data.t0.num_books = get_bits(gb, 4) + 1;
|
||||
|
||||
@@ -1050,6 +1062,9 @@ static int vorbis_floor0_decode(vorbis_context *vc,
|
||||
unsigned amplitude, book_idx;
|
||||
unsigned blockflag = vc->modes[vc->mode_number].blockflag;
|
||||
|
||||
if (!vf->amplitude_bits)
|
||||
return 1;
|
||||
|
||||
amplitude = get_bits(&vc->gb, vf->amplitude_bits);
|
||||
if (amplitude > 0) {
|
||||
float last = 0;
|
||||
@@ -1651,6 +1666,45 @@ static int vorbis_decode_frame(AVCodecContext *avccontext, void *data,
|
||||
|
||||
av_dlog(NULL, "packet length %d \n", buf_size);
|
||||
|
||||
if (*buf == 1 && buf_size > 7) {
|
||||
init_get_bits(gb, buf+1, buf_size*8 - 8);
|
||||
vorbis_free(vc);
|
||||
if ((ret = vorbis_parse_id_hdr(vc))) {
|
||||
av_log(avccontext, AV_LOG_ERROR, "Id header corrupt.\n");
|
||||
vorbis_free(vc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (vc->audio_channels > 8)
|
||||
avccontext->channel_layout = 0;
|
||||
else
|
||||
avccontext->channel_layout = ff_vorbis_channel_layouts[vc->audio_channels - 1];
|
||||
|
||||
avccontext->channels = vc->audio_channels;
|
||||
avccontext->sample_rate = vc->audio_samplerate;
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
if (*buf == 3 && buf_size > 7) {
|
||||
av_log(avccontext, AV_LOG_DEBUG, "Ignoring comment header\n");
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
if (*buf == 5 && buf_size > 7 && vc->channel_residues && !vc->modes) {
|
||||
init_get_bits(gb, buf+1, buf_size*8 - 8);
|
||||
if ((ret = vorbis_parse_setup_hdr(vc))) {
|
||||
av_log(avccontext, AV_LOG_ERROR, "Setup header corrupt.\n");
|
||||
vorbis_free(vc);
|
||||
return ret;
|
||||
}
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
if (!vc->channel_residues || !vc->modes) {
|
||||
av_log(avccontext, AV_LOG_ERROR, "Data packet before valid headers\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/* get output buffer */
|
||||
vc->frame.nb_samples = vc->blocksize[1] / 2;
|
||||
if ((ret = ff_get_buffer(avccontext, &vc->frame)) < 0) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user